Bug 843656 - nodejs - how can I change the config to run myserver.js rather than server.js
Summary: nodejs - how can I change the config to run myserver.js rather than server.js
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Ram Ranganathan
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-26 22:31 UTC by Nam Duong
Modified: 2015-05-14 22:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-01 05:56:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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