storage-upload/api/test/routes.mjs
2022-08-13 21:52:45 +00:00

24 lines
479 B
JavaScript

import config from '../config.mjs'
export default class TestRoutes {
constructor(opts = {}) {
Object.assign(this, { })
}
register(server) {
server.flaska.get('/', this.static.bind(this))
server.flaska.get('/error', this.error.bind(this))
}
static(ctx) {
ctx.body = {
name: config.get('name'),
version: config.get('version'),
environment: config.get('NODE_ENV'),
}
}
error(ctx) {
throw new Error('This is a test')
}
}