Quickstart
Please note that for now, we are supporting Express 4. Support for Express 5 will be out very soon.
1. Install required dependencies
npm i dotpress express@4 zod
2. Create a simple server
// index.ts
import { createApp, defineRoute } from 'dotpress'
defineRoute({
path: '/hello',
method: 'get',
handler: async () => {
return { message: 'Hello World!' }
}
})
const app = await createApp()
app.listen(3000, () => {
console.log('Server listening on port 3000')
})
3. Run your app and call your route
curl http://localhost:3000/hello
# { "message": "Hello World!" }
You are up and running!