1.4.0 • Published 10 months ago
@oliverjam/hypa v1.4.0
hypa
A minimal TypeScript server framework for building simple apps. Designed for modern runtimes like Bun.
Getting started
Install in your project:
npm install @oliverjam/hypaConfigure JSX via tsconfig.json:
{
"jsx": "react-jsx",
"jsxImportSource": "@oliverjam/hypa"
}Create a server:
import { router } from "router";
let app = router();
app.route("/").get(() => <h1>Hello world</h1>);
app.route("*").get((c) => c.status(404).html(<h1>Not found</h1>));
let server = Bun.serve(app);
console.log(`Listening on http://localhost:${server.port}`);