2020-03-22 11:39:12 +00:00
|
|
|
const express = require('express');
|
|
|
|
const app = express();
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
// set the server port
|
|
|
|
app.set('port', process.env.PORT || 3423);
|
|
|
|
|
|
|
|
// set the view engine to ejs
|
|
|
|
app.set('views', path.join(__dirname, 'views'));
|
|
|
|
app.set('view engine', 'ejs');
|
|
|
|
|
|
|
|
//serve files in public directory
|
2020-03-22 14:22:56 +00:00
|
|
|
app.use(
|
|
|
|
['/chart', '/'],
|
|
|
|
express.static(path.join(__dirname, 'public'), { maxAge: 2592000 })
|
|
|
|
);
|
2020-03-22 11:39:12 +00:00
|
|
|
|
|
|
|
app.listen(app.get('port'), function() {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log('API Reference started on PORT:' + app.get('port'));
|
|
|
|
});
|