1.0.38 • Published 2 years ago

@amaui/api v1.0.38

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

Getting started

Add

  yarn add @amaui/api

Use

  import express from 'express';
  import { Route, Method, IRouteClassInstance, Routes } from '@amaui/api';

  class Base implements IRouteClassInstance {

    public response(req: express.Request, response: express.Response, options: { method: 'json' | 'send', type: 'application/json', }) { return ...; }

    public error(req: express.Request, error: Error) { return ...; }

  }

  // Add decorator to a class representing a route
  @Route(
    '/a',
    method
  )
  class A extends Base {

    @Method(
      'get',
      '/a',
      method1
    )
    public a() { }

  }

  // Create an express app
  const app = express();

  // Register all classes as app routes
  Routes([A], app);

  // app routes:
  // GET /a/a, middlewares: method, method1

  // etc.

Dev

Install

  yarn

Test

  yarn test

Prod

Build

  yarn build
1.0.18

2 years ago

1.0.17

2 years ago

1.0.38

2 years ago

1.0.16

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.15

2 years ago

1.0.36

2 years ago

1.0.14

2 years ago

1.0.35

2 years ago

1.0.13

2 years ago

1.0.34

2 years ago

1.0.11117

2 years ago

1.0.11114

2 years ago

1.0.11113

2 years ago

1.0.1

3 years ago

1.0.1111

3 years ago

1.0.11

3 years ago

1.0.11111

3 years ago

1.0.0

3 years ago