@twin.org/api-server-fastify 0.0.3-next.20 → 0.0.3-next.21
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 +1 -1
- package/docs/changelog.md +17 -1
- package/docs/examples.md +37 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN API Server Fastify
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides Fastify web server integration for exposing API routes with consistent runtime behaviour. It builds on the Fastify framework to offer a predictable hosting layer for API services.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.3-next.21](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.3-next.20...api-server-fastify-v0.0.3-next.21) (2026-03-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **api-server-fastify:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-core bumped from 0.0.3-next.20 to 0.0.3-next.21
|
|
16
|
+
* @twin.org/api-models bumped from 0.0.3-next.20 to 0.0.3-next.21
|
|
17
|
+
* @twin.org/api-processors bumped from 0.0.3-next.20 to 0.0.3-next.21
|
|
2
18
|
|
|
3
19
|
## [0.0.3-next.20](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.3-next.19...api-server-fastify-v0.0.3-next.20) (2026-02-09)
|
|
4
20
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Server Fastify Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to build and run the Fastify server with explicit lifecycle control in scripts and integration tests.
|
|
4
|
+
|
|
5
|
+
## FastifyWebServer
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { FastifyWebServer } from '@twin.org/api-server-fastify';
|
|
9
|
+
|
|
10
|
+
const webServer = new FastifyWebServer();
|
|
11
|
+
|
|
12
|
+
await webServer.build(undefined, undefined, undefined, undefined, {
|
|
13
|
+
port: 8080,
|
|
14
|
+
host: '0.0.0.0'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
await webServer.start();
|
|
18
|
+
const instance = webServer.getInstance();
|
|
19
|
+
|
|
20
|
+
console.log(instance.server.address() !== null); // true
|
|
21
|
+
|
|
22
|
+
await webServer.stop();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { FastifyWebServer } from '@twin.org/api-server-fastify';
|
|
27
|
+
|
|
28
|
+
const webServer = new FastifyWebServer();
|
|
29
|
+
|
|
30
|
+
await webServer.build(undefined, undefined, undefined, undefined, {
|
|
31
|
+
port: 3000,
|
|
32
|
+
host: '127.0.0.1'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await webServer.start();
|
|
36
|
+
await webServer.stop();
|
|
37
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-server-fastify",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.21",
|
|
4
|
+
"description": "Fastify web server integration for exposing API routes with consistent runtime behaviour.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/api.git",
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fastify/compress": "8.3.
|
|
18
|
-
"@fastify/cors": "11.
|
|
19
|
-
"@twin.org/api-core": "0.0.3-next.
|
|
20
|
-
"@twin.org/api-models": "0.0.3-next.
|
|
21
|
-
"@twin.org/api-processors": "0.0.3-next.
|
|
17
|
+
"@fastify/compress": "8.3.1",
|
|
18
|
+
"@fastify/cors": "11.2.0",
|
|
19
|
+
"@twin.org/api-core": "0.0.3-next.21",
|
|
20
|
+
"@twin.org/api-models": "0.0.3-next.21",
|
|
21
|
+
"@twin.org/api-processors": "0.0.3-next.21",
|
|
22
22
|
"@twin.org/context": "next",
|
|
23
23
|
"@twin.org/core": "next",
|
|
24
24
|
"@twin.org/logging-models": "next",
|
|
25
25
|
"@twin.org/nameof": "next",
|
|
26
26
|
"@twin.org/web": "next",
|
|
27
|
-
"fastify": "5.
|
|
28
|
-
"socket.io": "4.8.
|
|
27
|
+
"fastify": "5.7.4",
|
|
28
|
+
"socket.io": "4.8.3"
|
|
29
29
|
},
|
|
30
30
|
"main": "./dist/es/index.js",
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|