-
Notifications
You must be signed in to change notification settings - Fork 418
/
app.js
31 lines (26 loc) · 897 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* eslint-disable consistent-return */
/* eslint-disable no-console */
/* eslint-disable import/no-extraneous-dependencies */
const compression = require('compression');
const express = require('express');
const minimist = require('minimist');
const port = process.env.PORT || 9001;
const argv = minimist(process.argv.slice(2));
const buildFolder = argv.folder || 'storybook';
// Setting buildFolder to 'storybook-based-tests' will allow interactive viewing of the Storyshots (story based tests).
// Create server
const app = express();
// Compress all files
app.use(compression());
// Static directories
app.use(
'/assets',
express.static(
`${__dirname}/node_modules/@salesforce-ux/design-system/assets/`
)
);
app.use(express.static(`${__dirname}/${buildFolder}`));
// Listen
const server = app.listen(port, () => {
console.log('Server listening on port ', server.address().port);
});