Wezi is small, minimalist, fast, adaptive, library
to create web applications.
Features
- Small Easy to learn and adapt.
- Simplicity Based on laws of simplicity.
- Fast Performance really near to native 🔥.
- High control Extremely versatile, low level abstraction, you have the control.
- Focus opt-in: All features are opt-in.
- Async Implements an enhanced async control of handlers execution.
npm install weziimport wezi, { listen } from 'wezi'
import { text } from 'wezi-send'
const w = wezi(c => text(c, 'Hi!'))
listen(w())Simple rounting
import wezi, { Context, listen } from 'wezi'
import router, { get } from 'wezi-router'
import { json } from 'wezi-send'
import createError from 'wezi-error'
type GetOneParam = {
id?: string
}
const validateGetOneParams = (c: Context, params: GetOneParam) => params.id
? c.next(params.id)
: c.panic(createError(400, 'the param "id", is required'))
const getOne = (c: Context, id: string) => json(c, {
id
, name: 'foo'
, surname: 'bar'
})
const r = router(get('/users/:id', validateGetoneParams, getOne))
const w = wezi()
listen(w(r))curl http://localhost:3000/users/123Note: If u are using Javascript remember enable ESM support in you package.json. esm_enabling

