1.0.4 • Published 3 years ago

blossa v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Blossa

The edge API framework for Cloudflare Workers.

Blossa is a fast and lightweight web framework for Cloudflare workers. It's loosely inspired by Express, with a focus on minimizing boilerplate and providing a solid and modern fundation to highly scalable APIs.

import Blossa from "blossa";

const app = new Blossa();

app.use(({event, response, ...ctx}, next) => {
    next({...ctx, event, response});
});
app.get('/hello',({response}) => {
    return response.send("world");
});

app.post('/ping', ({response}) => {
    return response.json({message:"pong"});
});

app.get('/error', ({response}) => {
    return response
        .status(500)
        .statusText('Error')
        .send({error: "Huston we have a problem"});
});

app.post('/hellouser/', async ({event, response}) => {
    const body = await event.request.json();
    return response
        .send(`Hello ${body.username}`);
});

Features

  • Middleware layer
  • Minimal footprint.
  • Straightforward API.
  • Built for Cloudflare Workers
  • Typescript support
  • Thoroughly tested

Roadmap

  • Full test coverage
  • Typescript
  • Complete usage Example
  • Middleware support
  • Custom context and plugin support
  • Documentation

Installation

$ npm install blossa

Tests

Run the test suite with npm test after installing the dependencies.

$ npm install
$ npm test
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.0

4 years ago