Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Configuration] Is painful to configure working through proxy #10

Open
avengerweb opened this issue Aug 8, 2018 · 1 comment
Open
Labels
question Further information is requested

Comments

@avengerweb
Copy link

For example, I wanna use nginx and proxy both API and Web, but currently I need change configurations in webpack and some other places to do that, but I only want:
api -> localhost:3001 -> proxy -> api.test-domain.com:80
web -> localhost:3000 -> proxy -> test-domain.com

But when I try to do that without any changes, my browser start try do request to localhost:3000 / localhost:3001

@timkurvers
Copy link
Member

timkurvers commented Aug 8, 2018

@avengerweb First off, thanks for giving the project a try!

The following environment variables should be of interest to tweak what is served where:

  • API_PORT - Port to serve the API on (default: 3001)
  • API_URI - Full URI to the API (default: http://localhost:$API_PORT/graphql)
  • PIPELINE_URI - Full URI to the pipeline, which serves game resources (default: http://localhost:$API_PORT/pipeline)
  • WEB_PORT - Port to serve the web app on during development (default: 3000)

The defaults for these environment variables are in .envrc-sample. To make changes, copy .envrc-sample to .envrc and source the file. Alternatively, simply export-ing the env variables for the user running the processes should suffice.

The API is a live process, so needs to be started using npm start. If you plan on making changes to the web client for Spelunker, set WEB_PORT to whichever port you want to run the development webpack server on and use npm run start. If you however plan to host it somewhere statically, use npm run build.

Make sure to restart these processes (or make a new static build) if you make any changes to environment variables.

Let us know how you get on!

@timkurvers timkurvers added the question Further information is requested label Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants