I am new to the expressjs, I am planning to use this boilerplate for my rest api project. I want to know how do i extend the existing routes to update or create rest api. out of the box if i run the code it works for http://localhost:8080/api/facets/ I want to extend the route like http://localhost:8080/api/facets/create or http://localhost:8080/api/facets/list
i am confused in the file express-es6-rest-api/src/api/index.js and express-es6-rest-api/src/api/facets.js
please explain below code:
export default ({ config, db }) => {
let api = Router();
// mount the facets resource
api.use('/facets', facets({ config}));
// perhaps expose some API metadata at the root
api.get('/', (req, res) => {
console.log(api)
res.json({ version });
});
return api;
}