mirror of
https://github.com/jlengrand/sample-node-api.git
synced 2026-03-10 08:41:23 +00:00
start restart script, missing feature
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
This commit is contained in:
@@ -125,6 +125,14 @@ from TN3270 terminal
|
||||
/s ZOWESVR
|
||||
```
|
||||
|
||||
Or, we can use zowe helper scripts to restart zowe
|
||||
```
|
||||
ssh ibmuser@my.mainframe.com
|
||||
cd /u/zowe/ibmuser/1.0.0/scripts
|
||||
./zowe-stop.sh
|
||||
./zowe-start.sh
|
||||
```
|
||||
|
||||
### 2) Access newly deployed webservice behind api/v1
|
||||
`https://my.mainframe.com:7554/api/v1/sample-node-api/accounts/`
|
||||
`https://my.mainframe.com:7554/api/v1/sample-node-api/accounts/1/`
|
||||
|
||||
7
scripts/restart-sample-node-api.sh
Normal file
7
scripts/restart-sample-node-api.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo 'restarting sample node api...'
|
||||
ps -elf | awk '/node/ && /app.js/ && !/sh -c/' | awk '{print $3}' | xargs kill -9 $1
|
||||
./start-sample-node-api.sh
|
||||
sleep 30
|
||||
echo 'restart done'
|
||||
@@ -1,8 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# find node bin
|
||||
# export NODE_HOME=/usr/lpp/IBM/cnj/IBM/node-v6.14.4-os390-s390x
|
||||
# export NODE_HOME=/usr/lpp/IBM/cnj/IBM/node-v6.14.4-os390-s390x
|
||||
if [ ! -z "$NODE_HOME" ]; then
|
||||
NODE_BIN=${NODE_HOME}/bin/node
|
||||
NPM_CLI=${NODE_HOME}/lib/node_modules/npm/bin/npm-cli.js
|
||||
else
|
||||
echo "Error: cannot find node bin, node app did not start"
|
||||
exit 1
|
||||
@@ -15,4 +18,4 @@ SCRIPT_DIR=$(dirname "$0")
|
||||
cd "$SCRIPT_DIR/.."
|
||||
|
||||
# start service
|
||||
$NODE_BIN server/app.js &
|
||||
$NODE_BIN $NPM_CLI run start > sample-node-api.log &
|
||||
@@ -3,10 +3,16 @@ const router = express.Router({ mergeParams: true });
|
||||
|
||||
const accountsCarsController = require('../controllers/accountsCars.controller');
|
||||
|
||||
/*
|
||||
// Add missing feature
|
||||
// un-comment this to implement two new routes
|
||||
// accounts/:id/cars & accounts/:id/cars/:id2
|
||||
|
||||
router.route('/cars')
|
||||
.get(accountsCarsController.getAll);
|
||||
|
||||
router.route('/cars/:_id')
|
||||
.get(accountsCarsController.get);
|
||||
*/
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user