forked from monarch-initiative/monarch-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-server.sh
executable file
·31 lines (27 loc) · 992 Bytes
/
start-server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# ./start-server.sh [ENVNAME]
#
# ENVNAME: dev, stage, production (default is 'dev')
# Optional environment variables:
# PORT (defaults to 8080)
#
# Special ENV names:
# - CORSTest: This is the same as 'dev', but it overrides the defaultConfig.app_base
# to be http://127.0.0.1:8080, which is distinct enough from http://localhost:8080 that
# cross-origin references will occur when using Phenogrid, even though the app_base is pointing
# to the local developer server. If CORS is improperly configured in webapp.js, then these
# references should cause an error in the browser, which a developer can detect and correct.
# Currently, webapp.js is configured to accept CORS requests and respond correctly.
#
RUNENV=$1
if [ ! $RUNENV ]; then
RUNENV=dev
fi
if [ $PORT ]
then
MARGS="--port $PORT"
else
MARGS="--port 8080"
fi
export NODE_PATH=./lib/monarch
node --harmony_destructuring ./lib/monarch/web/webapp_launcher.js $MARGS $RUNENV 2>&1 | tee start-server.log