UNPKG

paradigm-core

Version:
26 lines (16 loc) 734 B
const {Dispatcher: {dispatch}} = require('structure-core') const Controller = require('./controllers/themes') const express = require('express') const routes = express.Router() const controller = new Controller() routes.get(`/:id`, dispatch(controller, 'getById')) routes.get(`/`, dispatch(controller, 'getAll')) routes.patch(`/:id`, dispatch(controller, 'updateById')) routes.post(`/`, dispatch(controller, 'create')) routes.delete(`/:id`, dispatch(controller, 'deleteById')) module.exports = function routeInterface(options = {}) { return { routeName: 'themes', routes } }