Skip to content

Commit

Permalink
adds ability to run server on dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
smohadjer committed Feb 9, 2023
1 parent 225057d commit 9e9d723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bin/server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const express = require('express');
const app = express();
const PORT = 3000;
const args = process.argv.slice(2);
const folder = args[0];
const PORT = args[1] || 3000;

app.use(express.static('public'));
app.use(express.static(folder));

/*
app.get('/', (req, res) => {
res.send('Hello World!');
});
*/

app.listen(PORT, () => console.log(`Server listening on port: ${PORT}`));
app.listen(PORT, () => console.log(`Server listening on port: ${PORT} and root folder: "${folder}"`));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "build",
"version": "0.1.14",
"version": "0.1.15",
"description": "A frontend build for HTML Websites",
"repository": {
"type": "git",
Expand Down

0 comments on commit 9e9d723

Please sign in to comment.