Bug 843656 - nodejs - how can I change the config to run myserver.js rather than server.js
nodejs - how can I change the config to run myserver.js rather than server.js
Status: CLOSED NOTABUG
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 18:31 EDT by Nam Duong
Modified: 2015-05-14 18:57 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-01 01:56:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nam Duong 2012-07-26 18:31:24 EDT
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 01:56:26 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.