Skip to content

Commit

Permalink
chore: launch web browser
Browse files Browse the repository at this point in the history
Issue #47
  • Loading branch information
lewismoten committed Sep 2, 2019
1 parent 49016f7 commit 3f645b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ app.listen(PORT);

console.log(`Website running on port ${PORT}`);

const url = `http://localhost:${PORT}/docs/index.html`;
const start =
process.platform == "darwin"
? "open"
: process.platform == "win32"
? "start"
: "xdg-open";
require("child_process").exec(`${start} ${url}`);

const getContentType = ext =>
({
".js": "text/javascript",
Expand Down

0 comments on commit 3f645b5

Please sign in to comment.