1.0.38 • Published 8 months ago
@amaui/api v1.0.38
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
9 months ago
1.0.17
9 months ago
1.0.38
8 months ago
1.0.16
10 months ago
1.0.22
9 months ago
1.0.21
9 months ago
1.0.26
9 months ago
1.0.25
9 months ago
1.0.24
9 months ago
1.0.23
9 months ago
1.0.29
9 months ago
1.0.28
9 months ago
1.0.27
9 months ago
1.0.33
9 months ago
1.0.32
9 months ago
1.0.31
9 months ago
1.0.30
9 months ago
1.0.37
8 months ago
1.0.15
10 months ago
1.0.36
8 months ago
1.0.14
10 months ago
1.0.35
9 months ago
1.0.13
10 months ago
1.0.34
9 months ago
1.0.11117
1 year ago
1.0.11114
1 year ago
1.0.11113
1 year ago
1.0.1
2 years ago
1.0.1111
2 years ago
1.0.11
2 years ago
1.0.11111
2 years ago
1.0.0
2 years ago