0.15.1 • Published 4 years ago

@random-guys/siber v0.15.1

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

siber

Controllers as classes. This lib abstracts away the internals of controllers.

How to install?

yarn add @random-guys/siber

Also, you need yarn add inversify-express-utils

How does it work?

my.controller.ts

export class MyController extends Controller<MyResponseType> {
  @httpGet('/', myMiddleWare)
  async getData(@request() req: Request, @response() res: Response) {
    try {
      // ...do somethings
      this.handleSuccess(req, res, myResponse);
    } catch (err) {
      this.handleError(req, res, err);
    }
  }
}

In your ioc.ts

import { Container } from 'inversify';
import './my.controller.ts';

const container = new Container();
export default container;

Finally, in your app.ts

const server = new InversifyExpressServer(container, null);
.server.setConfig((app: Application) => {
  siber.buildInto(app, logger, {
    cors: false,
    jsend: true,
    tracking: true
  })
})

TODO

  • Tests
  • Refactor filesystem structure
  • Removed dependency on JSend
  • Move integration code to new packages
    • siber-bucket
    • siber-provcs
0.15.0

4 years ago

0.15.1

4 years ago

0.14.1

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.13.1

5 years ago

0.13.2

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago