Skip to content
Snippets Groups Projects
Commit 0be3c4bc authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add infrastructure route base

parent d1d53fb2
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!85Indicador infraestrutura
Pipeline #
const express = require('express');
const infrastructureApp = express.Router();
const libs = `${process.cwd()}/libs`;
const log = require(`${libs}/log`)(module);
const squel = require('squel');
const query = require(`${libs}/middlewares/query`);
const response = require(`${libs}/middlewares/response`);
const ReqQueryFields = require(`${libs}/middlewares/reqQueryFields`);
const config = require(`${libs}/config`);
const cache = require('apicache').options({ debug: config.debug, statusCodes: {include: [200]} }).middleware;
let rqf = new ReqQueryFields();
infrastructureApp.use(cache('15 day'));
rqf.addField({
name: 'filter',
field: false,
where: true
}).addField({
name: 'dims',
field: true,
where: false
})
//TODO: add rqf values
infrastructureApp.get('/', rqf.parse(), (req, res, next) => {
next();
}, rqf.build(), query, response('infrastructure'));
module.exports = infrastructureApp;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment