Skip to content

Commit af110d2

Browse files
committed
Add Bunicorn
1 parent 7b8c836 commit af110d2

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

javascript/bunicorn/app.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { RouteBuilder, BunicornApp } from "@bunicorn/server";
2+
3+
const app = new BunicornApp({ basePath: "/" });
4+
const rb = new RouteBuilder();
5+
app.addRoutes([
6+
rb.get("/", (ctx) => ctx.ok()),
7+
rb.get("/user/:id", (ctx) => ctx.raw(ctx.params.id)),
8+
rb.post("/user", (ctx) => ctx.ok()),
9+
]);
10+
11+
// @ts-expect-error
12+
Bun.serve({
13+
fetch(req: Request) {
14+
return app.handleRequest(req);
15+
},
16+
port: 3000,
17+
});

javascript/bunicorn/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
framework:
2+
website: https://github.com/ragokan/bunicorn
3+
version: 0.1
4+
5+
engines:
6+
- bun

javascript/bunicorn/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@bunicorn/server": "~0.0.1"
4+
}
5+
}

0 commit comments

Comments
 (0)