Compare commits
2 Commits
fa9fd1a33a
...
268189c972
Author | SHA1 | Date | |
---|---|---|---|
|
268189c972 | ||
|
0bfceb637e |
18
package.json
18
package.json
@ -4,13 +4,6 @@
|
||||
"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",
|
||||
@ -22,13 +15,20 @@
|
||||
"morgan": "^1.9.0",
|
||||
"serve-favicon": "^2.5.0",
|
||||
"vhost": "^3.0.2",
|
||||
"wo-base-envar": "git+https://git.faronear.org/npm/wo-base-envar",
|
||||
"wo-core-toolkit": "git+https://git.faronear.org/npm/wo-core-toolkit"
|
||||
"wo-base-envar": "git+https://git.tic.cc/npm/wo-base-envar",
|
||||
"wo-core-toolkit": "git+https://git.tic.cc/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"
|
||||
}
|
||||
}
|
||||
|
@ -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' : '_webroot', // local path to serve as webroot. 'unpackage/dist/build/h5'
|
||||
webRoot: process.env.NODE_ENV === 'production' ? '_webroot' : 'unpackage/dist/build/web', // local path to serve as webroot. 'unpackage/dist/build/h5'
|
||||
webIndex: 'index.html',
|
||||
webSsl:
|
||||
process.env.NODE_ENV === 'production'
|
||||
@ -45,8 +45,7 @@ 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()
|
||||
@ -209,4 +208,4 @@ console.log({ _at: new Date().toJSON(), about: '******** Environment Variables *
|
||||
}
|
||||
|
||||
return webServer
|
||||
})()
|
||||
})()
|
||||
|
Loading…
Reference in New Issue
Block a user