Skip to content

Instantly share code, notes, and snippets.

@bunlongheng
Last active March 1, 2019 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunlongheng/6220921db113b16487860e5844dcdaac to your computer and use it in GitHub Desktop.
Save bunlongheng/6220921db113b16487860e5844dcdaac to your computer and use it in GitHub Desktop.
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