Getting Started
This page contains guides for using Byte with Bun and Deno.
Bun
Install @bit-js/byte
as a dependency:
bun add @bit-js/byte
A simple echo server in Bun:
import { Byte } from '@bit-js/byte';
const app = new Byte() .get('/', (ctx) => ctx.body('Hi'));
export default app;
Navigate to 127.0.0.1:3000. It should show Hi
as a result.
Deno
A simple echo server in Deno:
import { Byte } from 'npm:@bit-js/byte';
const app = new Byte() .get('/', (ctx) => ctx.body('Hi'));
Deno.serve({ port: 3000 }, app.fetch);
Navigate to 127.0.0.1:3000. It should show Hi
as a result.