-
Notifications
You must be signed in to change notification settings - Fork 13
/
start_services.sh
executable file
·55 lines (41 loc) · 1.03 KB
/
start_services.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#
# this script starts the cso2 master server services
# to stop the services press CTRL+C
# you can customize the variables below
#
set -e
# customizable variables start
# defines the environment where the services are running
# can be 'development' or 'production'
export NODE_ENV=development
# mongodb database connection information
export DB_HOST=127.0.0.1
export DB_PORT=27017
export DB_NAME=cso2
# the ports which the services will listen to
export USERS_PORT=30100
export INVENTORY_PORT=30101
export WEBAPP_PORT=8080
# information used by the master server
# tells it where the user and inventory services are
export USERSERVICE_HOST=127.0.0.1
export USERSERVICE_PORT=$USERS_PORT
export INVSERVICE_HOST=127.0.0.1
export INVSERVICE_PORT=$INVENTORY_PORT
# customizable variables end
trap "exit" INT TERM ERR
trap "kill 0" EXIT
cd ./users-service
node dist/service.js &
cd ../
cd ./inventory-service
node dist/service.js &
cd ../
cd ./master-server
node dist/server.js &
cd ../
cd ./webapp
node dist/app.js &
cd ../
wait