mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 15:49:10 +00:00
22 lines
565 B
JavaScript
22 lines
565 B
JavaScript
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
|
|
app.use(
|
|
['/chart', '/'],
|
|
express.static(path.join(__dirname, 'public'), { maxAge: 2592000 })
|
|
);
|
|
|
|
app.listen(app.get('port'), function() {
|
|
// eslint-disable-next-line no-console
|
|
console.log('API Reference started on PORT:' + app.get('port'));
|
|
});
|