diff --git a/index.js b/index.js index 6fda9d3..d01ce21 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ const hafas = require('db-hafas') const createApi = require('hafas-rest-api') -const createLogging = require('hafas-rest-api/logging') const hsts = require('hsts') const pkg = require('./package.json') @@ -10,20 +9,17 @@ const stations = require('./lib/stations') const allStations = require('./lib/all-stations') const config = { - hostname: process.env.HOSTNAME || '1.db.transport.rest', + hostname: process.env.HOSTNAME || '2.db.transport.rest', port: process.env.PORT || 3000, name: pkg.name, - homepage: pkg.homepage + homepage: pkg.homepage, + logging: true } -const api = createApi(hafas, config) - -api.use(createLogging()) - -api.get('/stations', stations) -api.get('/stations/all', allStations) - -module.exports = api +const api = createApi(hafas, config, (api) => { + api.get('/stations', stations) + api.get('/stations/all', allStations) +}) api.listen(config.port, (err) => { if (err) {