Remove minimist

This commit is contained in:
Wildan M 2021-08-22 07:35:03 +07:00
commit 5a0cdc2a07
4 changed files with 9 additions and 35 deletions

25
app.js
View file

@ -1,8 +1,6 @@
// production endpoint (use pm2/phusion/whatever) // production endpoint (use pm2/phusion/whatever)
const argv = require('minimist')(process.argv.slice(2));
const app = require("./index.js"); const app = require("./index.js");
const https = require('https'); const https = require('https');
const tls = require('tls'); const tls = require('tls');
const certnode = require('certnode') const certnode = require('certnode')
@ -110,22 +108,11 @@ const main = async () => {
} }
} }
}, app.listeners[0]); }, app.listeners[0]);
httpsServer.listen(443);
app.listen(80);
}; };
main().catch((err) => {
// if (!argv.maintainerEmail) console.log(err);
// throw new Error('--maintainerEmail is required'); process.exit(1);
});
// require("greenlock-express")
// .init({
// packageRoot: __dirname,
// configDir: "./greenlock.d",
// // contact for security and critical bug notices
// maintainerEmail: argv.maintainerEmail,
// // whether or not to run at cloudscale
// cluster: false
// })
// // Serves on 80 and 443
// // Get's SSL certificates magically!
// .serve(app);

View file

@ -1,8 +1,7 @@
// development endpoint (use ngrok) // development endpoint (use ngrok)
const http = require('http'); const http = require('http');
const argv = require('minimist')(process.argv.slice(2)); const port = (process.argv.length >= 2 ? parseInt(process.argv[2]) : 0) || 3000;
const port = parseInt(argv.port || 3000);
const record_prefix = 'forward-domain='; const record_prefix = 'forward-domain=';
const { const {

13
package-lock.json generated
View file

@ -9,8 +9,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"certnode": "^0.0.1", "certnode": "^0.0.1"
"minimist": "^1.2.5"
} }
}, },
"node_modules/axios": { "node_modules/axios": {
@ -98,11 +97,6 @@
"is-buffer": "~1.1.6" "is-buffer": "~1.1.6"
} }
}, },
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"node_modules/os-tmpdir": { "node_modules/os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@ -203,11 +197,6 @@
"is-buffer": "~1.1.6" "is-buffer": "~1.1.6"
} }
}, },
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",

View file

@ -11,7 +11,6 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"certnode": "^0.0.1", "certnode": "^0.0.1"
"minimist": "^1.2.5"
} }
} }