Installation
Install the package in a Bun project.
sh
bun add @almighty-shogun/bun-serversh
npm install @almighty-shogun/bun-serversh
pnpm add @almighty-shogun/bun-serversh
yarn add @almighty-shogun/bun-serverUse it from Bun runtime code:
ts
import { createServer, defineRoute, HttpMethod } from '@almighty-shogun/bun-server';
const routes = {
health: defineRoute('/health', HttpMethod.Get, (_, response) => {
return response.json({ ok: true });
})
};
createServer({ port: 3000, routes });