@whook/whook
Version:
Build strong and efficient REST web services.
43 lines • 1.23 kB
JavaScript
import { autoService, location } from 'knifecycle';
export const definition = {
path: '/ping',
method: 'get',
operation: {
operationId: 'getPing',
summary: "Checks API's availability.",
tags: ['system'],
responses: {
200: {
description: 'Pong',
content: {
'application/json': {
schema: {
type: 'object',
additionalProperties: false,
properties: {
pong: {
type: 'string',
enum: ['pong'],
},
},
},
},
},
},
},
},
};
async function initGetPing({ ENV }) {
const response = {
status: 200,
headers: {
'X-Node-ENV': ENV.NODE_ENV,
},
body: {
pong: 'pong',
},
};
return (async () => response);
}
export default location(autoService(initGetPing), import.meta.url);
//# sourceMappingURL=getPing.js.map