@titanpl/route 26.16.2 → 26.16.4
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 +12 -5
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# @titanpl/route
|
|
2
2
|
|
|
3
|
-
The declarative Routing DSL
|
|
3
|
+
The declarative Routing DSL for Titan Planet.
|
|
4
4
|
|
|
5
5
|
## What it works (What it does)
|
|
6
|
-
This is
|
|
6
|
+
This is a zero-runtime-overhead DSL used to define your backend API routes. It captures routing metadata that the Titan engine uses to static-map requests directly to your actions.
|
|
7
7
|
|
|
8
8
|
## How it works
|
|
9
|
-
|
|
9
|
+
Import `t` and use it to define your endpoints.
|
|
10
10
|
|
|
11
11
|
```javascript
|
|
12
|
-
import
|
|
12
|
+
import t from "@titanpl/route";
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Define an action-based route
|
|
15
|
+
t.post("/hello").action("hello"); // pass a json payload { "name": "titan" }
|
|
16
|
+
|
|
17
|
+
// Define a direct reply route
|
|
18
|
+
t.get("/").reply("Ready to land on Titan Planet 🚀");
|
|
19
|
+
|
|
20
|
+
// Configure the server
|
|
21
|
+
t.start(5100, "Titan Running!");
|
|
15
22
|
```
|
|
16
23
|
|
|
17
24
|
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titanpl/route",
|
|
3
|
-
"version": "26.16.
|
|
3
|
+
"version": "26.16.4",
|
|
4
4
|
"description": "Titan routing DSL",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"titan",
|
|
9
|
+
"titanpl",
|
|
10
|
+
"t8n",
|
|
11
|
+
"route",
|
|
12
|
+
"dsl",
|
|
13
|
+
"ezetgalaxy"
|
|
14
|
+
],
|
|
7
15
|
"types": "./index.d.ts",
|
|
8
16
|
"exports": {
|
|
9
17
|
".": {
|