koishi-plugin-express
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

koishi-plugin-express

express server for koishi

// use plugin
koishiApp.plugin('koishi-plugin-express', {
    koishiRoutes: 'ignore' | 'use',
    port: Number | undefined
    hostname: String | undefined
})
koishiRoutes behavior
ignore will not pass requests to koa server
use koa routes will be accessable from express server
default: ignore
options description
port will spin up http server when provided
hostname will be passed to http.createServer(port, hostname)
// using express
app.plugin({
    using: ['express'],
    apply({ express }) {
        express.get('/express', (req) => {
            req.send('express')
        })
    }
})

Readme

Keywords

none

Package Sidebar

Install

npm i koishi-plugin-express

Weekly Downloads

24

Version

4.0.0

License

MIT

Unpacked Size

16.1 kB

Total Files

8

Last publish

Collaborators

  • exsper