Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

How to run as a static server after npm run deploy:prod? #778

Closed
yannbertrand opened this issue May 4, 2016 · 3 comments
Closed

How to run as a static server after npm run deploy:prod? #778

yannbertrand opened this issue May 4, 2016 · 3 comments

Comments

@yannbertrand
Copy link

yannbertrand commented May 4, 2016

I'd like to serve a project inside a gh-pages static site. I've managed to launch the server with http-server but don't know how to do it without having control of a server.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented May 5, 2016

You can just put a web server (e.g. nginx) in front of it as a reverse proxy (i.e. your-app.com/admin/dashboard should just serve your-app.com/ but keep the url structure intact so that the router can do its job). This allows the compiled files to be served to the client; basically, if you're not going to use an app server like the one provided via Koa, whatever you use to serve it needs to perform that role.

This is fairly standard SOP for a single page app that doesn't perform universal rendering, so if you do some digging on setting up a reverse proxy there should be a good number of resources available.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented May 5, 2016

https://www.techandme.se/set-up-nginx-reverse-proxy/ might help; if not, I believe digital ocean has some great tutorials on this concept.

@dvdzkwsk
Copy link
Owner

dvdzkwsk commented May 5, 2016

Also, I forgot: we have an ongoing chore to improve the README for a more helpful and friendly deployment description. Going to close this in favor of #730, so if you have any more questions drop them there. Thanks!

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

No branches or pull requests

2 participants