Bug 843656

Summary: nodejs - how can I change the config to run myserver.js rather than server.js
Product: OKD Reporter: Nam Duong <nduong>
Component: ContainersAssignee: Ram Ranganathan <ramr>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: jofernan, mfisher
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-01 05:56:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nam Duong 2012-07-26 22:31:24 UTC
Description of problem:
A user on IRC pointed out that our KB article is no longer valid:
https://openshift.redhat.com/community/kb/kb-e1048-how-can-i-run-my-own-nodejs-script

Sure enough, the file ~/{appName}/conf/node.env no longer exists.  Even if I wrote one to use node_app=myserver.js, and restart the app, it will still try to call server.js.

The user tried changing ~/{appName}/repo/package.json to:
  "main": "myserver.js"
It will still execute server.js

How do I change it?

Comment 1 Ram Ranganathan 2012-08-01 05:56:26 UTC
node.env has been deprecated w/ the support for package.json. 

The way to get this working is to add the following to your package.json:
  "scripts": {
    "start": "node <relative-path-from-repo-dir>/myserver.js"
  },

That would start node up and use myserver.js as the script to run.