0.0.2 • Published 4 years ago

@routex/hooks v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Routex Hooks npm Travis CI Codecov Greenkeeper badge

Hooks for Routex.

Documentation - GitHub

Example

Install:

yarn add @routex/hooks
# or
npm add @routex/hooks

Setup your app:

const { Routex, TextBody } = require("routex");
const { hooksHandler, useGetParam, useSetBody } = require("@routex/hooks");

const port = process.env.PORT || 3000;
const app = new Routex();

app.get(
  "/:name",
  hooksHandler(() => {
    const name = useGetParam("name");

    useSetBody(new TextBody(name));
  })
);

app.listen(port).then(() => console.log(`Listening on ${port}`));

Support

We support all currently active and maintained Node LTS versions, include current Node versions.

Please file feature requests and bugs at the issue tracker.

0.0.2

4 years ago

0.0.1

4 years ago