githubgraphqlcodespacesgithub-codespaces

Setting up PERN Stack with Graphql Server on Github Codespaces


I have a working PERN app on my local machine (same repo), and trying to test on Github Codespaces.

When starting the GraphQL server on Github Codespace I'm getting erros when testing with Postman online Error: Exceeded maxRedirects. Probably stuck in a redirect loop:

Postman errors

I'm under the assumption I have three options based on other ppl's projects:

  1. Setup a Docker environment
  2. Resolve CORS or proxy setup
  3. Host the server on one repo and the frontend on another (and still tackle CORS and proxy issues)

Ideally in the end I want to continue testing and developing in Github Codespaces.

What's the best option for Codespaces development and the easiest for when I'm ready to deploy?


Solution

  • I never did successfully get Postman to work on Github Codespace... but I did however get my PERN stack running successfully and resolve the CORS and Network ERR issues I was ironically trying to troubleshoot with Postman.

    1. As suggested by @vladanpaunovic in a Github thread here, you can change a setting using GraphQL Playground. I did have to change from GraphiQL to GraphQL Playground to try out this suggestion.

    enter image description here

    1. Then in VS Code (I use the browser) for the Codespace, I made the Port Visibility to Public

    enter image description here