Victor Pudeyev
Victor Pudeyev

Reputation: 4538

what is the command-line options for selecting the server port for expressjs?

I am using this guy https://github.com/twilson63/express-coffee

To start the server, the docs say to issue this command: cake dev

is there a way to select the port number via the command line? Similar to rails s --port 3010?

Upvotes: 0

Views: 2451

Answers (3)

mayognaise
mayognaise

Reputation: 161

Put "PORT=XXXX" before "cake dev" :)

PORT=2000 cake dev

Upvotes: 4

chovy
chovy

Reputation: 75774

$ NODE_PORT=3000 node ./app.js

inside app.js

var port = process.env.NODE_PORT;

Upvotes: 2

David Weldon
David Weldon

Reputation: 64332

Based on the Cakefile it doesn't look like that's an option, but it should be easy to fix. Have a look at the Cakefile in frappe (a similar project).

Upvotes: 1

Related Questions