Support custom port when running server
This commit is contained in:
parent
78cec2be8c
commit
75aacf628f
|
@ -6,7 +6,10 @@ const {render} = require('./handlers/render');
|
||||||
|
|
||||||
const DEV = process.argv.includes('dev');
|
const DEV = process.argv.includes('dev');
|
||||||
const HOSTNAME = '127.0.0.1';
|
const HOSTNAME = '127.0.0.1';
|
||||||
const PORT = 8080;
|
let PORT = Number.parseInt(process.argv[2], 10);
|
||||||
|
if(Number.isNaN(PORT)) {
|
||||||
|
PORT = 8080;
|
||||||
|
}
|
||||||
|
|
||||||
function devMapper(file, type, data) {
|
function devMapper(file, type, data) {
|
||||||
if(!type.includes('text/html')) {
|
if(!type.includes('text/html')) {
|
||||||
|
|
Loading…
Reference in New Issue