WAPPI

raw JSON →
3.4.8 verified Sat Apr 25 auth: no javascript

WAPPI is a Node.js microservice API framework that provides a plain and practical interface for building APIs with built-in Prisma ORM integration, request validation, and automatic OpenAPI documentation. Current stable version is 3.4.8. Development is active, with regular releases. Key differentiators: zero-config Prisma integration, automatic route documentation via OpenAPI, and a plugin system for extending functionality. It simplifies building microservices by reducing boilerplate and enforcing structure.

error SyntaxError: Cannot use import statement outside a module
cause Attempting to use ESM import in a CommonJS Node.js project without proper configuration.
fix
Add "type": "module" in package.json or rename file to .mjs.
error Error: Cannot find module 'prisma'
cause Prisma package not installed or not in node_modules.
fix
Run npm install prisma as a dependency.
error TypeError: app.addEndpoint is not a function
cause Using an older version of WAPPI where addEndpoint was named addRoute or similar.
fix
Check WAPPI version; upgrade to v3+ and use addEndpoint method.
breaking WAPPI v3 drops CommonJS support; require() will throw an error.
fix Use ESM imports or dynamic import().
deprecated The `usePrisma` method is deprecated in favor of setting Prisma in the constructor config.
fix Pass `prisma` option in the Wappi constructor config object.
gotcha When using TypeScript, ensure `esModuleInterop` is true in tsconfig.json to avoid import issues.
fix Add `"esModuleInterop": true` to tsconfig.json compilerOptions.
gotcha WAPPI generates OpenAPI spec based on endpoint decorators; missing `response` decorator can cause missing response schemas.
fix Always annotate endpoints with `response({ status: 200, schema: ... })` for full documentation.
gotcha Path parameters must be prefixed with colon (e.g., `/user/:id`); using curly braces `{id}` will not match.
fix Use colon syntax for path parameters.
npm install wappi
yarn add wappi
pnpm add wappi

Shows initializing WAPPI with SQLite database, defining a simple GET endpoint with a path parameter, and starting the server.

import { Wappi, endpoint, param, body, response } from 'wappi'

const app = new Wappi({
  database: {
    provider: 'sqlite',
    url: 'file:./dev.db'
  }
})

const helloEndpoint = endpoint({
  method: 'GET',
  path: '/hello/:name',
  handler: ({ name }) => `Hello, ${name}!`
})

app.addEndpoint(helloEndpoint)

app.start(3000).then(() => console.log('Server running on http://localhost:3000'))