Back

I am implementing a Function using Node . but while I am hitting the API it's giving authentication

  • 0
  • Web
Sajda
3 Apr, 2023, 18:43

Can anyone please help me with this issue?

TL;DR
The user is experiencing an authentication issue while implementing a Node function and hitting an API. They are receiving an unauthorized error and have been directed to review the documentation carefully. The user has not provided any code-related information or request headers. The error code 500 suggests a server issue and it is confirmed that the app is running on localhost port 3000. The user is asked to share their `index.js` file for further assistance.
safwan
3 Apr, 2023, 18:46

can you show your index.js

Sajda
3 Apr, 2023, 18:54

Sure

Sajda
3 Apr, 2023, 18:54

Already given the screen shot

Sajda
3 Apr, 2023, 18:56
safwan
3 Apr, 2023, 18:57

are you sure the app is running on localhost port 3000?

safwan
3 Apr, 2023, 18:58

error code 500 means it's a server issue

safwan
3 Apr, 2023, 18:58

nothing related to code tbh

Sajda
3 Apr, 2023, 19:00
Sajda
3 Apr, 2023, 19:00

let me share my terminal Screen shot

Sajda
3 Apr, 2023, 19:01
Drake
3 Apr, 2023, 19:05

please don't tag people just because you need help with something as it's very disruptive

Sajda
3 Apr, 2023, 19:05

sorry for this 😦

Drake
3 Apr, 2023, 19:07

what did you put in the request headers?

Sajda
3 Apr, 2023, 19:11

I haven't put anything

Drake
3 Apr, 2023, 19:12

if runtime says it needs an INTERNAL_RUNTIME_KEY and you don't pass the same value as the X-Internal-Challenge header you'll get a unauthorized error. Please make sure you read through https://github.com/open-runtimes/open-runtimes/tree/main/runtimes/node-18.0#local-development carefully

Sajda
3 Apr, 2023, 19:13

Okay let me check and Thank you πŸ™‚

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more