mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:00 -04:00
22 lines
414 B
JavaScript
22 lines
414 B
JavaScript
class BaseController {
|
|
constructor() {
|
|
|
|
}
|
|
|
|
/**
|
|
* Send a response to express
|
|
*
|
|
* @param response
|
|
* @param status
|
|
* @param data
|
|
* @param contentType
|
|
*/
|
|
jsonResponse(response, status, data, contentType = 'application/json') {
|
|
response.type(contentType);
|
|
response.status(status);
|
|
response.json(data);
|
|
}
|
|
}
|
|
|
|
module.exports = BaseController;
|