fix(core.gbapp): Self-replication on Azure
This commit is contained in:
parent
3cca5044ee
commit
bf602c6b7d
7 changed files with 24 additions and 29 deletions
14
.vscode/launch.json
vendored
14
.vscode/launch.json
vendored
|
@ -5,14 +5,20 @@
|
|||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Debug Program",
|
||||
"program": "${workspaceRoot}/dist/src/app.js",
|
||||
"program": "${workspaceRoot}/boot.js",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
},
|
||||
"args":["--no-deprecation"],
|
||||
"skipFiles": ["node_modules/**/*.js"],
|
||||
"outFiles": ["${workspaceRoot}/dist/*.js"],
|
||||
"args": [
|
||||
"--no-deprecation"
|
||||
],
|
||||
"skipFiles": [
|
||||
"node_modules/**/*.js"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/dist/*.js"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
|
|
4
boot.js
Normal file
4
boot.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
#! /usr/bin / env node
|
||||
const GBServer = require("./dist/src/app").GBServer
|
||||
process.env.PWD = __dirname;
|
||||
GBServer.run();
|
2
gbot.cmd
2
gbot.cmd
|
@ -12,4 +12,4 @@ ECHO Compiling...
|
|||
CALL tsc
|
||||
|
||||
:ALLSET
|
||||
node dist/src/app.js
|
||||
node app.js
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "botserver",
|
||||
"version": "1.3.0",
|
||||
"description": "General Bot Community Edition open-core server.",
|
||||
"main": "./src/app.ts",
|
||||
"main": "./boot.js",
|
||||
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",
|
||||
"homepage": "https://github.com/pragmatismo-io/BotServer/#readme",
|
||||
"contributors": [
|
||||
|
@ -15,7 +15,7 @@
|
|||
"license": "AGPL-3.0",
|
||||
"preferGlobal": true,
|
||||
"bin": {
|
||||
"gbot": "./dist/src/app.js"
|
||||
"gbot": "./boot.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -31,7 +31,7 @@
|
|||
"test": "nyc --reporter=html --reporter=text mocha -r ts-node/register packages/**/*.test.ts ",
|
||||
"pretest": "npm run build",
|
||||
"coveralls": "npm run test && nyc report --reporter=text-lcov | coveralls",
|
||||
"start": "node ./dist/src/app.js",
|
||||
"start": "node ./boot.js",
|
||||
"watch:build": "tsc --watch",
|
||||
"watch:server": "nodemon './dist/index.js' --watch './dist'",
|
||||
"posttypedoc": "shx cp .nojekyll docs/reference/.nojekyll",
|
||||
|
|
|
@ -93,7 +93,7 @@ export class GBDeployer {
|
|||
(resolve: any, reject: any): any => {
|
||||
GBLog.info(`PWD ${process.env.PWD}...`);
|
||||
let totalPackages = 0;
|
||||
let paths = [urlJoin(process.env.PWD, '..', GBDeployer.deployFolder)];
|
||||
let paths = [urlJoin(process.env.PWD, GBDeployer.deployFolder)];
|
||||
const additionalPath = GBConfigService.get('ADDITIONAL_DEPLOY_PATH');
|
||||
if (additionalPath !== undefined && additionalPath !== '') {
|
||||
paths = paths.concat(additionalPath.toLowerCase().split(';'));
|
||||
|
|
15
src/app.ts
15
src/app.ts
|
@ -1,4 +1,3 @@
|
|||
#! /usr/bin / env node
|
||||
/*****************************************************************************\
|
||||
| ( )_ _ |
|
||||
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
|
||||
|
@ -72,19 +71,11 @@ export class GBServer {
|
|||
|
||||
public static run() {
|
||||
GBLog.info(`The Bot Server is in STARTING mode...`);
|
||||
process.env.PWD = __dirname;
|
||||
|
||||
// Creates a basic HTTP server that will serve several URL, one for each bot instance.
|
||||
|
||||
GBServer.globals = new RootData();
|
||||
const port = GBConfigService.getServerPort();
|
||||
const server = express();
|
||||
server.use(bodyParser.json());
|
||||
server.use(
|
||||
bodyParser.urlencoded({
|
||||
extended: true
|
||||
})
|
||||
);
|
||||
server.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
server.listen(port, () => {
|
||||
(async () => {
|
||||
|
@ -171,7 +162,3 @@ export class GBServer {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
// First line to run.
|
||||
|
||||
GBServer.run();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<configuration>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="iisnode" path="dist/src/app.js" verb="*" modules="iisnode"/>
|
||||
<add name="iisnode" path="boot.js" verb="*" modules="iisnode"/>
|
||||
</handlers>
|
||||
<rewrite>
|
||||
<rules>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<conditions>
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
|
||||
</conditions>
|
||||
<action type="Rewrite" url="dist/src/app.js"/>
|
||||
<action type="Rewrite" url="boot.js"/>
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
|
@ -35,5 +35,3 @@
|
|||
<httpErrors existingResponse="PassThrough" />
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue