rocjs / roc

🐦 Modern JavaScript Development Ecosystem
MIT License
425 stars 23 forks source link

Deployment to Nginx / Apache / IIS etc. #142

Closed konradzuwala closed 8 years ago

konradzuwala commented 8 years ago

Hello! I am wondering how do I deploy an application built by Roc into a webserver such as Apache/IIS? With webpack I simply had index.html file that included compiled JS app. With Roc I do get generated app.js, but no index.html file, which seems to be generated when I type roc start in production mode. But how do "get" it to put into my webserver directory? Thanks for help!

dlmr commented 8 years ago

By default Roc applications run in an "Universal" fashion, that means that they use server side rendering to make application load faster for end users. This requires that the application itself run using Node and then it is possible to place a proxy like nginx, Apache or similar in front of it.

Is that what you are referring to here, how to proxy a Roc application through one of those web servers?

konradzuwala commented 8 years ago

Hey! Yes, basically we want to have production build, automated deployment. Frontend served by Nginx or Apache, with node in the back. What we did currently was copying contents of build/client and source of index.html generated by roc into Apache root dir and, it worked fine. What we want to achieve is something like "roc start" but in Apache/Nginx environment that our customers uses. Thank you!

dlmr commented 8 years ago

You would approach this in the same way as normally when it comes to Node applications. That is running the application on the server and then using something like Apache or nginx as a reverse proxy.

Set Up Nginx as a Reverse Proxy Server

Hosting a Node.js application with Apache