1.0.0-beta.16 • Published 2 years ago

@ingress/router v1.0.0-beta.16

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

@ingress/router

The ingress router is an ingress addon that operates in an app driven by the @ingrss/http (or similar) driver. It's purpose is to enable requests to be handled by Controllers (classes) and Routes (methods).

The @ingress/router plugin introduces the @Controller and @Route decorators. @Controller exists on an instance, and facilitates dependency collection of groups of routes, which are declared by @Route decorated class methods.

Example

import { Router, Route } from '@ingress/router'

const router = new Router()
const { Controller } = router

@Controller('/group')
class RouteGroup {
  @Route.Get('/handler')
  handler() {
    return 'Hello World'
  }
}

The above example, declares a route at /group/handler that returns an HTTP 200 OK with a body content of Hello World and a Content-Type of ttext/plain;charset=UTF-8

Alternatively, instead of through decorators, routes can be defined using the API

API

1.0.0-beta.16

2 years ago

0.1.0-alpha.5

3 years ago

1.0.0-rc.20

5 years ago

1.0.0-rc.19

5 years ago

1.0.0-rc.18

6 years ago

1.0.0-rc.17

6 years ago

1.0.0-rc.16

6 years ago

1.0.0-rc.14

6 years ago

1.0.0-rc.13

6 years ago

1.0.0-rc.12

6 years ago

1.0.0-rc.11

7 years ago

1.0.0-rc.10

7 years ago

1.0.0-rc.9

7 years ago

1.0.0-rc.8

7 years ago

1.0.0-rc.7

7 years ago

1.0.0-rc.6

7 years ago

1.0.0-rc.5

7 years ago

1.0.0-rc.4

7 years ago

1.0.0-rc.3

8 years ago

1.0.0-rc.2

8 years ago

1.0.0-rc.1

8 years ago

1.0.0-beta.12

8 years ago

1.0.0-beta.11

8 years ago

1.0.0-beta.10

8 years ago

1.0.0-beta.9

8 years ago

1.0.0-beta.8

8 years ago

1.0.0-beta.7

8 years ago

1.0.0-beta.6

8 years ago

1.0.0-beta.5

8 years ago

1.0.0-beta.2

8 years ago

1.0.0-beta.1

8 years ago