@forinda/kickjs-http 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @forinda/kickjs-http
|
|
2
|
+
|
|
3
|
+
Express 5 application, router builder, RequestContext, middleware, and query parsing for KickJS.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @forinda/kickjs-http @forinda/kickjs-core express reflect-metadata
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- `Application` class with full lifecycle (setup, start, shutdown, HMR rebuild)
|
|
14
|
+
- `bootstrap()` for zero-boilerplate entry with Vite HMR
|
|
15
|
+
- `RequestContext` with typed body/params/query and response helpers
|
|
16
|
+
- `buildRoutes()` — builds Express routers from decorated controllers
|
|
17
|
+
- Built-in middleware: `requestId`, `validate`, `errorHandler`, `csrf`, `upload`
|
|
18
|
+
- ORM-agnostic query parsing: `parseQuery()`, `ctx.qs()`, `QueryBuilderAdapter`
|
|
19
|
+
- Graceful shutdown with `Promise.allSettled`
|
|
20
|
+
|
|
21
|
+
## Quick Example
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import 'reflect-metadata'
|
|
25
|
+
import { bootstrap } from '@forinda/kickjs-http'
|
|
26
|
+
import { UserModule } from './modules/users'
|
|
27
|
+
|
|
28
|
+
bootstrap({
|
|
29
|
+
modules: [UserModule],
|
|
30
|
+
apiPrefix: '/api',
|
|
31
|
+
defaultVersion: 1,
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Sub-path Imports
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { Application } from '@forinda/kickjs-http/application'
|
|
39
|
+
import { RequestContext } from '@forinda/kickjs-http/context'
|
|
40
|
+
import { csrf } from '@forinda/kickjs-http/middleware/csrf'
|
|
41
|
+
import { upload } from '@forinda/kickjs-http/middleware/upload'
|
|
42
|
+
import { parseQuery } from '@forinda/kickjs-http/query'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
[Full documentation](https://github.com/forinda/kick-js)
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forinda/kickjs-http",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Express 5 integration, router builder, RequestContext, and middleware for KickJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"cookie-parser": "^1.4.7",
|
|
59
59
|
"multer": "^2.1.1",
|
|
60
60
|
"reflect-metadata": "^0.2.2",
|
|
61
|
-
"@forinda/kickjs-core": "0.3.
|
|
61
|
+
"@forinda/kickjs-core": "0.3.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"express": "^5.1.0"
|