Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajjj001/naan
Opinionated mini web framework for Bun (POC)
https://github.com/ajjj001/naan
bun http javascript routing server web
Last synced: 27 days ago
JSON representation
Opinionated mini web framework for Bun (POC)
- Host: GitHub
- URL: https://github.com/ajjj001/naan
- Owner: ajjj001
- Created: 2022-07-09T09:34:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-09T15:48:15.000Z (over 2 years ago)
- Last Synced: 2023-07-02T15:33:40.060Z (over 1 year ago)
- Topics: bun, http, javascript, routing, server, web
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```js
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](https://choosealicense.com/licenses/mit/)