-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
25 lines (19 loc) · 727 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
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser')
const submodules = [
require('./modules/discount-code/app/app'),
require('./modules/discount-redemption-split/app/app'),
];
const app = express();
// parse application/json
app.use(bodyParser.json())
app.set('port', (process.env.PORT || 8080));
app.use('/', express.static(path.join(__dirname, 'home')));
app.use('/assets', express.static(path.join(__dirname, '/node_modules/@salesforce-ux/design-system/assets')));
submodules.forEach((sm) => sm(app, {
rootDirectory: __dirname,
}));
app.listen(app.get('port'), function() {
console.log(`Express is running at localhost: ${app.get('port')}`);
});