mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-17 22:06:27 +01:00
14 lines
286 B
TypeScript
14 lines
286 B
TypeScript
|
import * as express from 'express';
|
||
|
|
||
|
export default (res: express.Response, x?: any, y?: any) => {
|
||
|
if (x === undefined) {
|
||
|
res.sendStatus(204);
|
||
|
} else if (typeof x === 'number') {
|
||
|
res.status(x).send({
|
||
|
error: x === 500 ? 'INTERNAL_ERROR' : y
|
||
|
});
|
||
|
} else {
|
||
|
res.send(x);
|
||
|
}
|
||
|
};
|