forked from sunfish-prj/Anonymisation-Interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
28 lines (19 loc) · 740 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
'use strict';
var SwaggerExpress = require('swagger-express-mw');
var app = require('express')();
var yaml_config = require('node-yaml-config');
module.exports = app; // for testing
var config = {
appRoot: __dirname, // required config
};
var configuration = yaml_config.load(__dirname + '/config/server_config.yaml');
SwaggerExpress.create(config, function(err, swaggerExpress) {
if (err) { throw err; }
// install middleware
swaggerExpress.register(app);
//var server_setting = configuration.server_setting;
var port = process.env.PORT || configuration.server.port;
app.listen(port);
console.log('Anonymisation interface started! Listening on http://%s:%d',
configuration.server.host, port);
});