Skip to content

Commit

Permalink
Merge pull request #4 from MrSwitch/fix-dir-map
Browse files Browse the repository at this point in the history
fix: directory definition
  • Loading branch information
MrSwitch authored Apr 12, 2021
2 parents 7324a87 + 77570ce commit e74e8b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Empty file modified bin/localhost
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable no-console */
const localhost = require('./index.js');
const portfinder = require('portfinder');
const argv = require('minimist')(process.argv);
const argv = require('minimist')(process.argv.slice(2));

const port = argv.p || parseInt(process.env.PORT);
const dir = argv._.pop() || './';

if (!port) {
portfinder.basePort = 8080;
Expand All @@ -19,7 +20,7 @@ else {
}

function listen(port) {
localhost(argv._[0] || './').listen(port);
localhost(dir).listen(port);
console.log(`Starting //localhost${port !== 80 ? `:${port}` : ''}`);
}

Expand Down

0 comments on commit e74e8b9

Please # to comment.