0.3.2 • Published 2 years ago

bunsterjs v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago