Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
////配置监听函数
router.get('/', blog.getnews);
router.get('/blog/:id', blog.getblog);
router.get('/category/:category', blog.getblogbycategory);
router.get('/tag/:tag', blog.getblogbytag);
//admin
router.get('/admin', admin.index);
router.post('/api/authenticate', admin.auth);
////rest api
router.get('/api/blogs', api.list);
router.get('/api/blogs/:blogId', api.getBlog);
router.post('/api/blogs', api.createBlog);
router.put('/api/blogs', api.updateBlog);
router.delete('/api/blogs/:blogId', api.deleteBlog);
//load router
app.use(router.middleware());
return app;
}