mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 01:35:17 +01:00
26 lines
459 B
JavaScript
26 lines
459 B
JavaScript
export function ok(res, data = {}) {
|
|
return res.status(200).json(data);
|
|
}
|
|
|
|
export function redirect(res, url) {
|
|
res.setHeader('Location', url);
|
|
|
|
return res.status(303).end();
|
|
}
|
|
|
|
export function badRequest(res) {
|
|
return res.status(400).end();
|
|
}
|
|
|
|
export function unauthorized(res) {
|
|
return res.status(401).end();
|
|
}
|
|
|
|
export function forbidden(res) {
|
|
return res.status(403).end();
|
|
}
|
|
|
|
export function methodNotAllowed(res) {
|
|
res.status(405).end();
|
|
}
|