0.1.14 • Published 2 years ago

oily v0.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

Once you've got Bun.js installed, The installation is super simple, just run the following commands.

# Install Bun.js, If you haven't yet.
curl https://bun.sh/install | bash

# Use Bun's package manager to install, or you
# can use any package manager that supports Bun.js.
bun add oily

Usage

// file: ./src/index.ts
import { Oily } from "oily";

await Oily.serve({
  middleware: [
    async (request, next) => {
      // do something before.
      const response = await next();
      // do something after.

      return response;
    }
  ]
});

// now listening on port 3000.

Routes are found, by default, within the ./http/routes directory, next to the entrypoint.

// file: ./src/http/routes/foo.ts
import { Oily } from "oily";

export default Oily.route({
  methods: {
    get: {
      async handle() {
        return Response.json({
          foo: true
        });
      }
    }
  }
});
0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

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