Compare commits

...

2 Commits

Author SHA1 Message Date
luk
268189c972 [package.json] 排序,把 scripts 放到最后 2025-03-25 15:45:00 +08:00
luk
0bfceb637e rename git.faronear.org to git.tic.cc 2025-03-25 15:42:25 +08:00
2 changed files with 162 additions and 163 deletions

View File

@ -4,13 +4,6 @@
"description": "Launch web server", "description": "Launch web server",
"main": "webserver.js", "main": "webserver.js",
"author": "", "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": { "dependencies": {
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
"compression": "^1.7.3", "compression": "^1.7.3",
@ -22,13 +15,20 @@
"morgan": "^1.9.0", "morgan": "^1.9.0",
"serve-favicon": "^2.5.0", "serve-favicon": "^2.5.0",
"vhost": "^3.0.2", "vhost": "^3.0.2",
"wo-base-envar": "git+https://git.faronear.org/npm/wo-base-envar", "wo-base-envar": "git+https://git.tic.cc/npm/wo-base-envar",
"wo-core-toolkit": "git+https://git.faronear.org/npm/wo-core-toolkit" "wo-core-toolkit": "git+https://git.tic.cc/npm/wo-core-toolkit"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"nodemon": "^2.0.2", "nodemon": "^2.0.2",
"pm2": "^5.1.2", "pm2": "^5.1.2",
"supervisor": "^0.12.0" "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', webProtocol: process.env.NODE_ENV === 'production' ? 'httpall' : 'http',
webHostname: process.env.NODE_ENV === 'production' ? 'unknownhost' : 'localhost', webHostname: process.env.NODE_ENV === 'production' ? 'unknownhost' : 'localhost',
webPort: process.env.NODE_ENV === 'production' ? coretool.PORT_WEB_SERVER_DEV : undefined, 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', webIndex: 'index.html',
webSsl: webSsl:
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
@ -45,7 +45,6 @@ if (typeof wo.envar.webSsl === 'string') {
wo.envar.webSsl = eval(`(${wo.envar.webSsl})`) 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)) }) 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 ★★★★★★★★' }) console.log({ _at: new Date().toJSON(), about: '★★★★★★★★ Starting Server ★★★★★★★★' })