Skip to content
/ naan Public

Opinionated mini web framework for Bun (POC)

Notifications You must be signed in to change notification settings

ajjj001/naan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

naan

Proof of concept for building a mini web framework for Bun.

Demo

Route files need to be in the routes folder.

Controller files need to be in the controllers folder.

Demo

import { App } from "./src";

const app = new App();

app.use("GET", "/", (req) => {
  return new Response("Hello World!");
});

app.use("GET", "/v1/**", (req) => {
  return new Response("Wild card route");
});

app.use("POST", "/v1/users", (req) => {
  return new Response("POST /v1/users");
});

app.use("GET", "/method", (req) => {
  return new Response(req.method);
});

// Using users routes file from the routes folder
app.useRoutes("users");

app.serve(3000);

License

MIT

About

Opinionated mini web framework for Bun (POC)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published