Skip to content

Getting Started

This page contains guides for using Byte with Bun and Deno.

Bun

Install @bit-js/byte as a dependency:

Terminal window
bun add @bit-js/byte

A simple echo server in Bun:

index.ts
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:

index.ts
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.