0.3.2 • Published 8 months ago

bunsterjs v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

BunsterJs

Simple rest api framework for bun.

Features

  • Focus on simple and easy to use.
  • Fast Performance.
  • Built-in Zod input validator.
  • Built-in logger based on winston with log rotation.

Quickstart

const app = new Bunster();

app.get("/", (ctx) => ctx.sendText("Hi"));

app.post("/json", (ctx) => ctx.sendJson(ctx.body));

const inputSchema = {
    query: z.object({
        name: z.string(),
    }),
    params: z.object({
        id: z.coerce.number(),
    }),
};

app.get("/id/:id",(ctx) => {
    ctx.setHeader("x-powered-by", xPoweredBy);
    return ctx.sendText(`${ctx.params.id} ${ctx.query.name}`);
    },
    {
        input: inputSchema,
    }
);

app.serve({
    port: 4000,
});
0.3.2

8 months ago

0.3.1

8 months ago

0.3.0

8 months ago

0.2.9

8 months ago

0.2.8

8 months ago

0.2.7

8 months ago

0.2.6

8 months ago

0.2.5

8 months ago

0.2.4

8 months ago

0.2.3

8 months ago

0.2.2

8 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago