app2-api/modules/post/config/routes.js

12 lines
286 B
JavaScript
Raw Normal View History

2019-04-15 10:13:17 +00:00
const routes = require('express').Router();
routes.use((req, res, next) => {
// here we can access the req.params object and make auth checks
next();
});
routes.get('/posts', function (req, res) {
res.status(200).json({ message: 'Connected!' });
});
module.exports = routes;