UNPKG

preon

Version:

a smaller nodejs micro-service framework

15 lines (11 loc) 364 B
import { Middleware } from '@preon/core'; import * as Errors from 'exception.js'; export const test: Middleware = async (ctx) => { ctx.body = 'Hello World'; }; export const system: Middleware = async (ctx) => { ctx.body = require('../../package.json'); }; export const exception: Middleware = async () => { throw new Errors.ServiceUnavailable(); };