@kenote/koa
Using Koa web framework to Kenote.js.
Usage
index.ts
import { Module, ServerFactory } from '@kenote/core'
import { ServiceEngine } from '@kenote/koa'
@Module({
imports: [],
plugins: [],
middlewares: [],
httpException: {
notFound: (ctx: Context) => {
return ctx.status(404)
},
exception: (err: any, ctx: Context) => {
ctx.renderException('error', { message: 'This page could internal server error' })
}
}
})
class AppModule {}
async bootstarp () {
let factory = await ServerFactory(new ServiceEngine()).create(AppModule)
factory.server.listen(4000)
}
MIT License.