Licence
BSD-2-Clause
Version
0.1.127
Deps
1
Size
8 kB
Vulns
0
Weekly
404
@trenskow/app-express
A plugin for @trenskow/app that enables it to handle express.js routes.
Be aware that this plugin is experimental. Not all features of express is currently supported.
Installation and usage
Installation is pretty simple. You install it by registering the plugin.
import { Application, Endpoint } from '@trenskow/app';
import express from '@trenskow/app-express'
Application.plugin(express);
const app = new Application({ port: 8080 });
const root = new Endpoint()
.mount('ping', new Endpoint()
.express((req, res, /* next */) => {
res.json('pong')
}));
await app
.root(root)
.open();LICENSE
See license in LICENSE.