@kenote/koa
TypeScript icon, indicating that this package has built-in type declarations

1.0.32 • Public • Published

@kenote/koa

Using Koa web framework to Kenote.js.

NPM Version NPM Downloads Gratipay

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.

Readme

Keywords

Package Sidebar

Install

npm i @kenote/koa

Weekly Downloads

5

Version

1.0.32

License

MIT

Unpacked Size

99.3 kB

Total Files

52

Last publish

Collaborators

  • thondery