Compare commits

..

No commits in common. "268189c9726a5602bd6df5fa0ba991b2c6723b2b" and "fa9fd1a33a6fa3bebd16d933eb41b0bbafe47991" have entirely different histories.

2 changed files with 163 additions and 162 deletions

View File

@ -4,6 +4,13 @@
"description": "Launch web server",
"main": "webserver.js",
"author": "",
"scripts": {
"serving-dev-nodemon": "npx cross-env NODE_ENV=development npx nodemon webserver.js",
"serving-dev-pm2": "npx cross-env NODE_ENV=development npx pm2 start webserver.js",
"serving-prod-nodemon": "npx cross-env NODE_ENV=production npx nodemon webserver.js",
"serving-prod-pm2": "npx cross-env NODE_ENV=production npx pm2 start webserver.js",
"serving-prod-sup": "npx cross-env NODE_ENV=production npx supervisor -i node_modules,_webroot -- webserver.js"
},
"dependencies": {
"body-parser": "^1.18.2",
"compression": "^1.7.3",
@ -15,20 +22,13 @@
"morgan": "^1.9.0",
"serve-favicon": "^2.5.0",
"vhost": "^3.0.2",
"wo-base-envar": "git+https://git.tic.cc/npm/wo-base-envar",
"wo-core-toolkit": "git+https://git.tic.cc/npm/wo-core-toolkit"
"wo-base-envar": "git+https://git.faronear.org/npm/wo-base-envar",
"wo-core-toolkit": "git+https://git.faronear.org/npm/wo-core-toolkit"
},
"devDependencies": {
"cross-env": "^7.0.2",
"nodemon": "^2.0.2",
"pm2": "^5.1.2",
"supervisor": "^0.12.0"
},
"scripts": {
"serving-dev-nodemon": "npx cross-env NODE_ENV=development npx nodemon webserver.js",
"serving-dev-pm2": "npx cross-env NODE_ENV=development npx pm2 start webserver.js",
"serving-prod-nodemon": "npx cross-env NODE_ENV=production npx nodemon webserver.js",
"serving-prod-pm2": "npx cross-env NODE_ENV=production npx pm2 start webserver.js",
"serving-prod-sup": "npx cross-env NODE_ENV=production npx supervisor -i node_modules,_webroot -- webserver.js"
}
}

View File

@ -18,7 +18,7 @@ const wo = (global.wo = {
webProtocol: process.env.NODE_ENV === 'production' ? 'httpall' : 'http',
webHostname: process.env.NODE_ENV === 'production' ? 'unknownhost' : 'localhost',
webPort: process.env.NODE_ENV === 'production' ? coretool.PORT_WEB_SERVER_DEV : undefined,
webRoot: process.env.NODE_ENV === 'production' ? '_webroot' : 'unpackage/dist/build/web', // local path to serve as webroot. 'unpackage/dist/build/h5'
webRoot: process.env.NODE_ENV === 'production' ? '_webroot' : '_webroot', // local path to serve as webroot. 'unpackage/dist/build/h5'
webIndex: 'index.html',
webSsl:
process.env.NODE_ENV === 'production'
@ -45,7 +45,8 @@ if (typeof wo.envar.webSsl === 'string') {
wo.envar.webSsl = eval(`(${wo.envar.webSsl})`)
}
console.log({ _at: new Date().toJSON(), about: '******** Environment Variables ********', envar: JSON.parse(coretool.stringify_by_keyorder(wo.envar)) })
;(function serve () {
; (function serve () {
console.log({ _at: new Date().toJSON(), about: '★★★★★★★★ Starting Server ★★★★★★★★' })
const server = express()
@ -208,4 +209,4 @@ console.log({ _at: new Date().toJSON(), about: '******** Environment Variables *
}
return webServer
})()
})()