Skip to content

Instantly share code, notes, and snippets.

@bunlongheng
Last active Mar 1, 2019
Embed
What would you like to do?
const jwt = require('jwt-express');
const bodyParser = require('body-parser');
const controllers = require('../controllers');
module.exports = (app) => {
app.get('/', (req, res) => res.status(200).send({
message: 'Welcome to the API!',
}));
app.post('/fortinet-bpd', controllers.fortinet.bpd);
app.post('/fortinet-analyzer-bpd', controllers.fortinet.bpdAnalyzer);
app.put('/vse/ext/vcpe/:cpeMac/vlan/:vlanId/lan', controllers.fortinet.updateVlan);
app.put('/vse/ext/vcpe/:cpeMac', controllers.fortinet.updateCpe);
app.post('/vse/ext/vcpe', controllers.fortinet.createCpe);
app.delete('/vse/ext/vcpe/:cpeMac/vlan/:vlanId/lan', controllers.fortinet.deleteVlan);
app.delete('/vse/ext/vcpe', controllers.fortinet.deleteCpe);
app.put('/eventserver/ext/vcpe/:cpeMac', controllers.fortinet.updateCpe);
app.put('/eventserver/ext/vcpe', controllers.fortinet.updateCpe);
app.put('/eventserver/ext/vcpe/:cpeMac/vlan/:vlanId/lan', controllers.fortinet.updateVlan);
app.post('/eventserver/ext/vcpe', controllers.fortinet.createCpe);
app.delete('/eventserver/ext/vcpe/:cpeMac/vlan/:vlanId/lan', controllers.fortinet.deleteVlan);
app.delete('/eventserver/ext/vcpe', controllers.fortinet.deleteCpe);
//test
app.post('/bpd/getPolicyIdBaseOnPolicyName/:policyName', controllers.fortinet.getPolicyIdBaseOnPolicyName);
app.post('/bpd/getPolicyBaseOnName/:policyName', controllers.fortinet.getPolicyBaseOnName);
app.get('*', (req, res) => {
res.status(200).send({
message: 'Welcome to the beginning of nothingness.',
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment