oxarionjs
v1.3.1
Published
Powerfull Backend Framework Build on top of BunJS
Downloads
462
Maintainers
Readme
OxarionJs is a TypeScript-first backend framework built on Bun
It keeps the flow direct, the API clean, and the abstractions where they actually help
Why OxarionJs
- Built on Bun for fast runtime and a tight development loop
- Type-safe route params
- Route groups and middleware chains
- Route injector for modular structure
- File-based dynamic routing
- Request and response helpers
- Native WebSocket route support
- Minimal flow without high-level clutter
Install
bun add oxarionjsQuick start
import Oxarion, { Middleware } from "oxarionjs"
await Oxarion.start({
host: "127.0.0.1",
port: 3000,
httpHandler: (router) => {
router.addHandler("GET", "/", (_req, res) => {
res.json({ message: "Welcome to OxarionJs" })
})
},
safeMwRegister: (router) => {
router.multiMiddleware("/", [Middleware.cors(), Middleware.logger()], true)
},
})Run it with
bun run src/index.tsDynamic routing
import Oxarion from "oxarionjs"
await Oxarion.start({
dynamicRouting: {
dir: "dyn",
handlerFile: "api",
extensions: ["ts", "js"],
onConflict: "keepManual",
},
httpHandler: () => {},
})dyn/test/api.ts maps to /test
Route modules can export HTTP method functions or a static class
import { OxarionResponse, type OxarionRequest } from "oxarionjs"
export default class TestApi {
static async GET(req: OxarionRequest, _res: OxarionResponse) {
return OxarionResponse.json({ path: req.url() })
}
}Docs
Start here if you want the full guide
- Docs index
- Getting started
- Server options
- Routing
- Route Injector
- Dynamic routing
- Middleware
- Request and response
- WebSocket
- API reference
- Testing and benchmarking
