Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy node app with http-server and forever

I want to use http-server and forever.js to deploy my app to remote ubuntu server. But forever.js requires path to JS file, not to executable. So I can't pass keys to http-server. Best solution so far is to install http-server locally via npm and run something like this: forever start ./node_modules/http-server/bin/http-server. But in this case I can't set port and other options. What's the best practice?

like image 846
surganov Avatar asked Oct 19 '14 23:10

surganov


1 Answers

You can set the options using that code. Just use the available flags after the end of your command. For example:

forever start ./node_modules/http-server/bin/http-server -p 80 -d false
like image 99
jsejcksn Avatar answered Oct 14 '22 00:10

jsejcksn