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

Proxy don't work after production build #40

Closed
AdamDomagalsky opened this issue Sep 13, 2017 · 2 comments
Closed

Proxy don't work after production build #40

AdamDomagalsky opened this issue Sep 13, 2017 · 2 comments

Comments

@AdamDomagalsky
Copy link

I've cloned the repo, everything is working fine, but after runing npm run build and running a prod version of clinet - it looks like we are loosing connection between client and API.

Any ideas how to fix that?

@lomoY
Copy link

lomoY commented Oct 24, 2017

does it work well in your development environment? I follow the suggestion in this repo but it not works for me.

Then I set the below code in my server.js:

app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });

@auser
Copy link
Contributor

auser commented Nov 7, 2017

Yes, if you run the production build using the following code, the server will serve the production version of the application:

NODE_ENV=production npm run start

This will work only after you build the client:

(cd client && npm run build)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants