Small & Fast
Small bundles (~1MB with Prisma), no decorators, no reflection. Optimized for Lambda cold starts.
Build OpenAPI-compliant REST APIs with clean architecture, zero magic, and Lambda-first design.

import { defineModule, bootstrap, route, createRoutes } from 'glasswork';
import { object, string } from 'valibot';
// 1. Define your DTOs with Valibot
const LoginDto = object({
email: pipe(string(), email()),
password: pipe(string(), minLength(8)),
});
const SessionDto = object({
token: string(),
expiresAt: string(),
});
// 2. Create type-safe routes
export const authRoutes = createRoutes((router, { authService }, route) => {
router.post('/login', ...route({
tags: ['Auth'],
summary: 'User login',
public: true,
body: LoginDto,
responses: { 200: SessionDto },
handler: ({ body }) => {
// Body is fully typed from LoginDto
return authService.login(body.email, body.password);
},
}));
});
// 3. Define modules
export const AuthModule = defineModule({
name: 'auth',
basePath: 'auth',
providers: [AuthService],
routes: authRoutes,
});
// 4. Bootstrap
const { app } = bootstrap(AuthModule, {
openapi: { enabled: true }
});
export default app; // Ready for Lambda or local serverYour OpenAPI spec is automatically generated at /api/openapi.json.
Glasswork provides NestJS-style architecture optimized for serverless deployment.
It uses common patterns from NestJS (modules, DI, OpenAPI) with smaller bundle sizes and Lambda-optimized performance: