0.0.1-beta4 • Published 12 months ago

keiro v0.0.1-beta4

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

keiro

CI npm version Bundle size

A file-system router compatible with WinterGC.

⚡ Features

  • Middlewares
  • Request Locals
  • Worker Threads

📖 Check out the Docs

📦 Examples

// src/routes/index.ts
import { defineHandler } from "keiro";

export default defineHandler(() => {
  return new Response("Hello World");
});

🐢 Node

// src/main.ts
import express from "express";
import { fileSystemRouter } from "keiro/node";

const port = Number(process.env.PORT ?? 5022);
const origin = `http://localhost:${port}`;

const app = express();
app.use(fileSystemRouter({ origin }));

app.listen(port, () => {
  console.log(`Listening on http://localhost:${port}`);
});

🌐 Web

// src/main.ts
import { fileSystemRouter } from "keiro/web";

const port = Number(process.env.PORT ?? 5021);

const server = Bun.serve({
  port,
  fetch: fileSystemRouter(),
});

console.log(`Listening on http://${server.hostname}:${server.port}`);
0.0.1-beta4

12 months ago

0.0.1-beta3

12 months ago

0.0.1-beta2

12 months ago

0.0.1-beta1

12 months ago