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.
Common errors
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.
Warnings
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.
Install
npm install wappi yarn add wappi pnpm add wappi Imports
- Wappi wrong
const Wappi = require('wappi')correctimport { Wappi } from 'wappi' - endpoint wrong
import endpoint from 'wappi'correctimport { endpoint } from 'wappi' - WappiRequest wrong
import { WappiRequest } from 'wappi' (if only used as type)correctimport type { WappiRequest } from 'wappi'
Quickstart
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'))