20 lines
527 B
JavaScript
20 lines
527 B
JavaScript
const exceptionHandler = require('../middlewares/exception-handler');
|
|
|
|
const prefix = '/api/v1/';
|
|
/**
|
|
* Prefix for all API version 1 routes.
|
|
* @type {string}
|
|
*/
|
|
exports.prefix = prefix;
|
|
/**
|
|
* A function for configuring the Express application routing.
|
|
*
|
|
* @param {Express.Application} app The Express object of the application.
|
|
*/
|
|
exports.routify = (app) => {
|
|
require('./public')(app, prefix + 'public');
|
|
require('./user')(app, prefix + 'user');
|
|
require('./admin')(app, prefix + 'admin');
|
|
app.use(exceptionHandler);
|
|
};
|