Skip to content

Commit

Permalink
Create possibility to change the port
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbanov committed Aug 30, 2018
1 parent 580b9a6 commit 723a825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions boilerplate/server.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const args = require('yargs').argv;
const webpack = require("webpack");
const express = require("express");
const fs = require("fs");
const { JSDOM } = require("jsdom");
const { Script } = require("vm");
const PORT = args.port || process.env.PORT || 8080;

const app = express();
app.set("view engine", "ejs");
Expand Down Expand Up @@ -65,6 +67,6 @@ const renderElmApp = (bundleFile, url) =>
}, 1);
});

app.listen(8080, () =>
console.log("projectname listening on port http://localhost:8080")
app.listen(PORT, '0.0.0.0', () =>
console.log(`projectname listening on port http://localhost:${PORT}`)
);

0 comments on commit 723a825

Please sign in to comment.