OxarionJS is a powerful, modern, and lightweight backend framework built on top of Bun, designed for speed, simplicity, and full TypeScript support.
- Ultra Fast: Built on Bun for maximum performance.
- Lightweight: Tiny footprint, just 48kb for the core modules.
- TypeScript First: Enjoy full type safety and modern development experience.
- Expressive Routing: Dynamic routes with parameters (
/user/[id],/api/[...path]). - Built-in Middleware: CORS, JSON, URL-encoded, and more out of the box.
- WebSocket Support: Native, per-route WebSocket handlers.
- Form Data & File Uploads: Effortless form parsing and file handling.
- Gzip Compression: Automatic response compression.
- Static File Serving: Serve HTML and static assets with ease.
- Bun Test Integration: Write and run tests using Bun's test runner.
OxarionJS requires Bun (v1.2.19 or higher). If you don't have Bun installed, get it from https://bun.sh.
bun add oxarionjsimport Oxarion, { Middleware } from "oxarionjs";
// Start the server
Oxarion.start({
port: 3000,
debugRoutes: true,
// Define your routes
httpHandler: (router) => {
router.addHandler("GET", "/", (_, res) => {
res.json({ message: "Welcome to Oxarion!" });
});
},
// This function is called after httpHandler is registered
safeMwRegister: (router) => {
router.middlewareChain(
"/",
[Middleware.cors(), Middleware.json(), Middleware.urlencoded()],
true // This means it will be applied to all routes
);
},
});bun run <your-entry-file>.tsReplace <your-entry-file>.ts with the name of your main TypeScript file.
- Routing: Dynamic, parameterized, and nested routes.
- Middleware: Plug-and-play CORS, JSON, URL-encoded, and custom middleware.
- WebSocket: Built-in, per-route WebSocket support.
- Form Data: Simple form parsing and file upload handling.
- Compression: Automatic gzip compression for responses.
- Static Files: Serve static files and HTML pages effortlessly.
- Testing: Integrated with Bun's test runner for robust testing.
- Bun: v1.2.19 or higher Install Bun →
Need help or want to contribute? Check out the issues or open a pull request!