Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sumi demo

A blazing fast web API built with Sumi 🔥

Getting Started

Development

bun run dev

Project Structure

├── routes/                # API routes (file-based routing)
│   ├── index.ts          # GET /
│   └── users/            # /users/* routes
├── middleware/           # Global middleware
│   └── index.ts         # Request logging
├── src/
│   └── server.ts        # Application entry point
└── sumi.config.ts       # Sumi configuration

Adding Routes

Create files in the routes/ directory:

// routes/hello.ts
import { createRoute } from '@bethel-nz/sumi/router';

export default createRoute({
  get: (c) => c.json({ message: 'Hello World!' })
});

Validation with Zod

import { z } from 'zod';
import { createRoute } from '@bethel-nz/sumi/router';

const userSchema = z.object({
  name: z.string().min(1),
  email: z.string().email()
});

export default createRoute({
  post: {
    schema: { json: userSchema },
    handler: (c) => {
      const userData = c.valid.json;
      return c.json({ success: true, user: userData });
    }
  }
});

Deployment

Build and deploy your Sumi app anywhere that supports Bun or Node.js.

About

demo app created with sumi cli

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages