The most straightforward framework for the web.

Run the following to setup cheetah:

deno run -Ar https://deno.land/x/cheetah/setup.ts

Schema validation 🧙‍♂️

When building a large API with cheetah, you probably want some sort of validation to reduce the amount of boilerplate code to validate the body, query, cookies, and header of the incoming request.

import cheetah from 'https://deno.land/x/cheetah/mod.ts'
import z from 'https://deno.land/x/zod/mod.ts'

const app = new cheetah()

app.post('/', {
  body: z.object({
    email: z.string().email(),
    password: z.string()
  })
}, () => 'Hello!')

Secure 🪖

cheetah ensures that neither parsing freezes your application nor a malformed request causes a crash.

import cheetah from 'https://deno.land/x/cheetah/mod.ts'

const app = new cheetah()

app.post('/', async (c) => {
  const body = await c.req.buffer()
})

Chaining & nesting 🪹

cheetah doesn't dictate you how to write your app. Chain it, nest it, have fun with it!

import cheetah from 'https://deno.land/x/cheetah/mod.ts'

const app = new cheetah()
  .get('/cake', () => '🎂') // GET '/cake'
  .patch('/cookie', () => '🍪') // PATCH '/cookie'
  .put('/donut', () => '🍩') // PUT '/donut'

Pure perfection 💎

cheetah ranks among the fastest web frameworks for JavaScript and has a much shorter syntax compared to its competitors.

import cheetah from 'https://deno.land/x/[email protected]/mod.ts'

new cheetah()
  .get('/', () => 'Hey!')
  .serve()