0.1.6 • Published 5 years ago

hyrest-express v0.1.6

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

hyrest-express

npm pipeline status coverage report

Hyrest is a hybrid REST framework for both the client and the server.

This is the express middleware package.

Connect your hyrest controllers to Express and server them as a REST API.

Usage

Use the hyrest middleware to connect your controllers to express:

import { hyrest } from "hyrest-express";
import * as Express from express;
import * as BodyParser from "body-parser";
import { UserController } from "./user-controller";
import { GameController } from "./game-controller";

const app = Express();
app.use(Bodyparser.json());
app.use(hyrest(
    new UserController(),
    new GameController(),
));

app.listen(3000);

Everything else happens automatically.

Resources