0.24.0 • Published 3 years ago
@macchiatojs/kernel v0.24.0
@macchiatojs/kernel
Installation
# npm
$ npm install @macchiatojs/kernel
# yarn
$ yarn add @macchiatojs/kernel
Usage
I'm working to add full documentations as soon as possible <3.
// Express/Connect Style
import Macchiato, { Request, Response, Next } from "@macchiatojs/kernel";
const app = new Macchiato();
app.use((request: Request, response: Response, next?: Next) => {
response.body = "Hello World !"; // also you can use .send(200, "Hello World !")
});
app.start(2222);
// Koa Style
import Macchiato, { Context, Next } from "@macchiatojs/kernel";
const app = new Macchiato({ expressify: false });
app.use((context: Context, next?: Next) => {
context.response.body = "Hello World !"; // also you can use .send(200, "Hello World !")
});
app.start(2222);
If you want to use the famous koa-compose
for mws;
import Macchiato, { Context, Next } from "@macchiatojs/kernel";
// don't forget to add '@macchiatojs/wrap-koa-compose' and 'koa-compose'
import WrapKoaCompose from "@macchiatojs/wrap-koa-compose";
const app = new Macchiato({
koaCompose: new WrapKoaCompose<Context, Next>(),
});
Support
If you have any problem or suggestion please open an issue.
License
0.21.0
3 years ago
0.24.0
3 years ago
0.23.0
3 years ago
0.22.0
3 years ago
0.20.1
3 years ago
0.20.0
3 years ago
0.20.2
3 years ago
0.19.0
3 years ago
0.16.0
3 years ago
0.17.0
3 years ago
0.18.0
3 years ago
0.17.1
3 years ago
0.15.0
3 years ago
0.14.0
3 years ago
0.11.0
3 years ago
0.12.0
3 years ago
0.13.0
3 years ago
0.10.0
3 years ago
0.9.0
3 years ago
0.3.0
3 years ago
0.8.0
3 years ago
0.5.0
3 years ago
0.4.0
3 years ago
0.7.0
3 years ago
0.6.0
3 years ago
0.2.0
3 years ago
0.1.0
4 years ago