Search code examples
next.jsgitpod

Getting 401 error in postman using NextJS in Gitpod


Thanks for looking at my issue.

I am learning NextJS, and using Gitpod to test my exercise project. The code I wrote is just a simple API route which works when you type API route in the browser (it returns DATA in JSON as expected).

However when trying to check the API using postman (and Thunder VScode extension), I get 401 error.

I have tested similar code in Codesandbox, and it works fine using postman.

Can you please advise what am I missing?

Thanks,

enter image description here

enter image description here

enter image description here


Solution

  • Problem solved :) Thanks to Gitpod Port should have been set to Public

    enter image description here