Browse Source

ES5 syntax

pull/1168/head
Gibran Parvez 7 years ago
parent
commit
dc5954bf40
  1. 12
      app.js
  2. 2
      config/swagger.js

12
app.js

@ -1,7 +1,7 @@
const app = require('express')(); var app = require('express')();
const swaggerJSDoc = require('swagger-jsdoc'); var swaggerJSDoc = require('swagger-jsdoc');
const swaggerUi = require('express-swaggerize-ui'); var swaggerUi = require('express-swaggerize-ui');
const peliasConfig = require( 'pelias-config' ).generate(require('./schema')); var peliasConfig = require( 'pelias-config' ).generate(require('./schema'));
if( peliasConfig.api.accessLog ){ if( peliasConfig.api.accessLog ){
app.use( require( './middleware/access_log' ).createAccessLogger( peliasConfig.api.accessLog ) ); app.use( require( './middleware/access_log' ).createAccessLogger( peliasConfig.api.accessLog ) );
@ -27,10 +27,10 @@ app.use( require('./middleware/jsonp') );
/** ----------------------- routes ----------------------- **/ /** ----------------------- routes ----------------------- **/
const defaultRoutes = require('./routes/default'); var defaultRoutes = require('./routes/default');
defaultRoutes.addRoutes(app); defaultRoutes.addRoutes(app);
const v1 = require('./routes/v1'); var v1 = require('./routes/v1');
v1.addRoutes(app, peliasConfig); v1.addRoutes(app, peliasConfig);
/** ----------------------- error middleware ----------------------- **/ /** ----------------------- error middleware ----------------------- **/

2
config/swagger.js

@ -1,4 +1,4 @@
const options = { var options = {
'swaggerDefinition' : { 'swaggerDefinition' : {
'info': { 'info': {
'description': 'Swagger documentation for Pelias API', 'description': 'Swagger documentation for Pelias API',

Loading…
Cancel
Save