UNPKG

2.44 kBJavaScriptView Raw
1/*
2
3 ----------------------------------------------------------------------------
4 | qewd-up: Rapid QEWD API Development |
5 | |
6 | Copyright (c) 2018-19 M/Gateway Developments Ltd, |
7 | Redhill, Surrey UK. |
8 | All rights reserved. |
9 | |
10 | http://www.mgateway.com |
11 | Email: rtweed@mgateway.com |
12 | |
13 | |
14 | Licensed under the Apache License, Version 2.0 (the "License"); |
15 | you may not use this file except in compliance with the License. |
16 | You may obtain a copy of the License at |
17 | |
18 | http://www.apache.org/licenses/LICENSE-2.0 |
19 | |
20 | Unless required by applicable law or agreed to in writing, software |
21 | distributed under the License is distributed on an "AS IS" BASIS, |
22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
23 | See the License for the specific language governing permissions and |
24 | limitations under the License. |
25 ----------------------------------------------------------------------------
26
27 7 March 2019
28
29*/
30
31var child_process = require('child_process');
32
33module.exports = function(message, jwt, forward, sendBack) {
34
35 // will be moved during startup to /apis/importRoutes/onMSResponse.js
36 // if config.json shows imported to be false
37 // and if running in import mode
38
39 console.log('*** MicroService import completed - shutting down ***');
40
41 // delete the importRoutes API
42
43 var cmd = 'rm -r /opt/qewd/mapped/apis/importRoutes';
44 child_process.execSync(cmd, {stdio:[0,1,2]});
45
46 var _this = this;
47 setTimeout(function() {
48 _this.stop();
49 }, 1000);
50
51 return false;
52
53};
\No newline at end of file