jeevan

Simple web framework.

Usage no npm install needed!

<script type="module">
  import jeevan from 'https://cdn.skypack.dev/jeevan';
</script>

README

Jeevan

Simple web framework.

Usage

import { Context, Engine, JSONResponse } from 'jeevan'

const app = new Engine()

app.get('/hello/{name}', async (ctx: Context) => {
    return new JSONResponse({ hello: ctx.params.name })
})

app.post('/hello', async (ctx: Context) => {
    const body: { message: string } = await ctx.body()
    return new JSONResponse(body)
})

app.ws('/ws').on('connection', ws => {
    ws.on('message', msg => {
        ws.send(msg)
    })
})

app.serve(8000)

Contribute

Make a pull request.