Skip to content

Commit 20cd949

Browse files
committed
feat(*): add Express server for hosting static file builds
BDS-693
1 parent a33b710 commit 20cd949

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@
5555
"test:js:watch": "jest --watch",
5656
"test:php": "cd packages/core-php && composer run test",
5757
"test": "npm-run-all --parallel test:*",
58+
"serve": "node server.js",
5859
"watch:icons": "lerna exec --scope @bolt/components-icons -- yarn run watch"
5960
},
6061
"dependencies": {
6162
"sassdoc": "^2.5.0"
6263
},
6364
"devDependencies": {
6465
"editorconfig-checker": "^1.3.3",
66+
"express": "^4.16.3",
6567
"husky": "^0.14.3",
6668
"jest": "^23.5.0",
6769
"lerna": "^3.2.1",

server.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const express = require('express');
2+
const { join } = require('path');
3+
const app = express();
4+
5+
const port = process.env.PORT || 3123;
6+
7+
app.use(express.static(join(__dirname, './www')));
8+
9+
app.listen(port, () => {
10+
console.log(`Express listening on http://localhost:${port}`);
11+
});

0 commit comments

Comments
 (0)