You just need to add this code snippet to your package.json
:
"scripts": {
"start": "node app.js"
}
You can add numerous commands that run at various points in the life cycle of your package. For more details you can take a look at this link where it has the full specification.
By default the server expects to find a server.js
file in the project root, as in your case the file you need to execute is the app.js
you need to specify it.
Below is an example of a simple% wizard that will work for you.
{
"name": "[NOME DA SUA APLICAÇÃO]",
"version": "[VERSÃO]",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "~3.4.8"
}
}
If your application is still running locally and your server is not, it is very likely that the port you are reporting is not the one specified by the server. For example I use AppFog as the server, and the port to be used by the application is informed by an environment variable package.json
.
In my application it looks something like this:
app.set("port", process.env.VCAP_APP_PORT || 3000);
...
http.createServer(app).listen(app.get("port"));