18 lines
577 B
JavaScript
18 lines
577 B
JavaScript
let express = require('express');
|
|
let app = express();
|
|
let config = require('./config.js'),
|
|
database = require('./database.js'),
|
|
auth = require('./auth.js');
|
|
|
|
app.engine('html', require('hogan-express'));
|
|
app.set('view engine', 'html');
|
|
app.use('/static', express.static('static'));
|
|
app.use(function(request, response, next) {
|
|
auth.init(request, response, next);
|
|
});
|
|
app.use('/', require('./router.js'));
|
|
|
|
app.listen(config.app.port, function() {
|
|
database.init();
|
|
console.log(`Softphone started at http://127.0.0.1:${config.app.port}`);
|
|
}); |