Skip to content

Commit bf6883b

Browse files
committed
chore(release): 1.1.4
1 parent 463dcbf commit bf6883b

8 files changed

+50
-20
lines changed

docs/classes/_poppinss_http_server.middlewarestore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Middleware store register and keep all the application middleware at one place.
77
The middleware store transparently relies on `Ioc.use` and `Ioc.make` globals. If you are not using the IoC container, then simply register all middleware as plain functions and not `ioc namespaces`.
88

99
*__example__*:
10-
```
10+
```ts
1111
const store = new MiddlewareStore()
1212

1313
store.register([

docs/classes/_poppinss_http_server.route.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Route class is used to construct consistent [RouteDefination](../modules/_poppinss_http_server.md#routedefination) using fluent API. An instance of route is usually obtained using the [Router](_poppinss_http_server.router.md) class helper methods.
66

77
*__example__*:
8-
```js
8+
```ts
99
const route = new Route('posts/:id', ['GET'], async function () {
1010
})
1111

docs/classes/_poppinss_http_server.routegroup.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ ___
100100

101101
**as**(name: *`string`*): `this`
102102

103-
Prepend name to the routes name
103+
Prepend name to the routes name.
104+
105+
*__example__*:
106+
```ts
107+
Route.group(() => {
108+
}).as('version1')
109+
```
104110

105111
**Parameters:**
106112

@@ -117,7 +123,13 @@ ___
117123

118124
**domain**(domain: *`string`*): `this`
119125

120-
Define domain for all the routes
126+
Define domain for all the routes.
127+
128+
*__example__*:
129+
```ts
130+
Route.group(() => {
131+
}).domain(':name.adonisjs.com')
132+
```
121133

122134
**Parameters:**
123135

@@ -134,7 +146,13 @@ ___
134146

135147
**middleware**(middleware: *`any` \| `any`[]*): `this`
136148

137-
Prepend an array of middleware to all routes middleware
149+
Prepend an array of middleware to all routes middleware.
150+
151+
*__example__*:
152+
```ts
153+
Route.group(() => {
154+
}).middleware(['auth'])
155+
```
138156

139157
**Parameters:**
140158

@@ -151,7 +169,13 @@ ___
151169

152170
**namespace**(namespace: *`string`*): `this`
153171

154-
Define namespace for all the routes inside the group
172+
Define namespace for all the routes inside the group.
173+
174+
*__example__*:
175+
```ts
176+
Route.group(() => {
177+
}).namespace('App/Admin/Controllers')
178+
```
155179

156180
**Parameters:**
157181

@@ -168,7 +192,13 @@ ___
168192

169193
**prefix**(prefix: *`string`*): `this`
170194

171-
Define prefix all the routes in the group
195+
Define prefix all the routes in the group.
196+
197+
*__example__*:
198+
```ts
199+
Route.group(() => {
200+
}).prefix('v1')
201+
```
172202

173203
**Parameters:**
174204

@@ -185,7 +215,13 @@ ___
185215

186216
**where**(param: *`string`*, matcher: *`RegExp` \| `string`*): `this`
187217

188-
Define Regex matchers for a given param for all the routes
218+
Define Regex matchers for a given param for all the routes.
219+
220+
*__example__*:
221+
```ts
222+
Route.group(() => {
223+
}).where('id', /^[0-9]+/)
224+
```
189225

190226
**Parameters:**
191227

docs/classes/_poppinss_http_server.router.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
Router class exposes unified API to create new routes, group them or create route resources.
66

77
*__example__*:
8-
```js
8+
```ts
99
const router = new Router()
10+
1011
router.get('/', async function () {
1112
// handle request
1213
})

docs/classes/_poppinss_http_server.routeresource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Resource route helps in defining multiple conventional routes. The support for shallow routes makes it super easy to avoid deeply nested routes. Learn more [http://weblog.jamisbuck.org/2007/2/5/nesting-resources](http://weblog.jamisbuck.org/2007/2/5/nesting-resources).
66

77
*__example__*:
8-
```js
8+
```ts
99
const resource = new RouteResource('articles', 'ArticlesController')
1010
```
1111

docs/classes/_poppinss_http_server.store.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Store class is used to store a list of routes, along side with their tokens to match the URL's. The used data structures to store information is tailored for quick lookups.
66

77
*__example__*:
8-
```js
8+
```ts
99
const store = new Store()
1010

1111
store.add({
@@ -52,7 +52,7 @@ store.match('posts/1', 'GET')
5252
Adds a route to the store for all the given HTTP methods. Also an array of tokens is generated for the route pattern. The tokens are then matched against the URL to find the appropriate route.
5353

5454
*__example__*:
55-
```js
55+
```ts
5656
store.add({
5757
pattern: 'post/:id',
5858
methods: ['GET'],

docs/modules/_poppinss_http_server.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,6 @@ ___
435435

436436
**● E_INVALID_ROUTE_NAMESPACE**: *`string`* = "E_INVALID_ROUTE_NAMESPACE"
437437

438-
___
439-
<a id="exceptioncodes.e_missing_controller_method"></a>
440-
441-
#### E_MISSING_CONTROLLER_METHOD
442-
443-
**● E_MISSING_CONTROLLER_METHOD**: *`string`* = "E_MISSING_CONTROLLER_METHOD"
444-
445438
___
446439
<a id="exceptioncodes.e_missing_named_middleware"></a>
447440

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@poppinss/http-server",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Extracted copy of AdonisJs HTTP server along with it's router",
55
"main": "build/index.js",
66
"files": [

0 commit comments

Comments
 (0)