StricJS è un framework Bun per costruire applicazioni web e API ad alte prestazioni.
- Veloce — Stric è uno dei framework Bun più veloci. Consulta benchmark per ulteriori dettagli.
- Minimale — I componenti di base come
@stricjs/routere@stricjs/utilssono sotto i 50kB e non richiedono dipendenze esterne. - Estensibile — Stric include un sistema di plugin, dependency injection e ottimizzazioni opzionali per la gestione delle richieste.
Usa bun init per creare un progetto vuoto.
bash
mkdir myapp
cd myapp
bun init
bun add @stricjs/router @stricjs/utilsPer implementare un semplice server HTTP con StricJS:
ts
import { Router } from "@stricjs/router";
export default new Router().get("/", () => new Response("Ciao"));Per servire file statici da /public:
ts
import { dir } from "@stricjs/utils";
export default new Router().get("/", () => new Response("Ciao")).get("/*", dir("./public"));Esegui il file in modalità watch per avviare il server di sviluppo.
bash
bun --watch run index.tsPer ulteriori informazioni, consulta la documentazione di Stric.