Remove some koa leftovers
This commit is contained in:
parent
11c1133696
commit
0961d4b2dd
2 changed files with 0 additions and 29 deletions
|
@ -5,15 +5,3 @@ export class HttpError extends Error {
|
||||||
this.status = status
|
this.status = status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function errorMiddleware(ctx, next) {
|
|
||||||
try {
|
|
||||||
await next()
|
|
||||||
} catch (e) {
|
|
||||||
ctx.status = e.status || 500
|
|
||||||
ctx.body = {
|
|
||||||
status: ctx.status,
|
|
||||||
message: e.message,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { performance } from 'perf_hooks'
|
import { performance } from 'perf_hooks'
|
||||||
import Koa from 'koa-lite'
|
|
||||||
import { Flaska, QueryHandler } from 'flaska'
|
import { Flaska, QueryHandler } from 'flaska'
|
||||||
|
|
||||||
import TestRoutes from './test/routes.mjs'
|
import TestRoutes from './test/routes.mjs'
|
||||||
|
@ -8,22 +7,6 @@ import MediaRoutes from './media/routes.mjs'
|
||||||
import config from './config.mjs'
|
import config from './config.mjs'
|
||||||
import log from './log.mjs'
|
import log from './log.mjs'
|
||||||
|
|
||||||
/*
|
|
||||||
import router from './router.mjs'
|
|
||||||
import { errorMiddleware } from './error.mjs'
|
|
||||||
|
|
||||||
const app = new Koa()
|
|
||||||
|
|
||||||
app.use(errorMiddleware)
|
|
||||||
app.use(router.routes())
|
|
||||||
app.use(router.allowedMethods())
|
|
||||||
|
|
||||||
const server = app.listen(config.get('server:port'), function(a,b) {
|
|
||||||
log.info(`Server listening at ${config.get('server:port')}`)
|
|
||||||
})
|
|
||||||
|
|
||||||
export default server */
|
|
||||||
|
|
||||||
const app = new Flaska({
|
const app = new Flaska({
|
||||||
log: log,
|
log: log,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue