backendium 0.0.5 → 0.0.6
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/package.json +1 -1
- package/readme.md +7 -3
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
> 1. [Installation](#installation)
|
|
5
5
|
> 2. [Basics](#basics)
|
|
6
6
|
> 3. [Routing](#routing)
|
|
7
|
+
> 4. [Request validation](#request-validation-checkeasy)
|
|
8
|
+
> 5. [Authorization](#authorization)
|
|
9
|
+
> 6. [Dynamic routing](#dynamic-routing)
|
|
10
|
+
> 7. [Websocket](#websocket)
|
|
7
11
|
# Installation
|
|
8
12
|
```bash
|
|
9
13
|
npm i backendium checkeasy
|
|
@@ -43,7 +47,7 @@ app.start();
|
|
|
43
47
|
```
|
|
44
48
|
```typescript
|
|
45
49
|
// handlers.ts
|
|
46
|
-
import {BackendiumRouter} from "backendium
|
|
50
|
+
import {BackendiumRouter} from "backendium";
|
|
47
51
|
|
|
48
52
|
const router = new BackendiumRouter;
|
|
49
53
|
|
|
@@ -214,7 +218,7 @@ websocketRequest()
|
|
|
214
218
|
```
|
|
215
219
|
## Init
|
|
216
220
|
```typescript
|
|
217
|
-
router.ws<string>("/ws
|
|
221
|
+
router.ws<string>("/ws-init")
|
|
218
222
|
.event("test", (data, socket) => {
|
|
219
223
|
socket.send(socket.initData);
|
|
220
224
|
})
|
|
@@ -228,7 +232,7 @@ websocketRequest<number>()
|
|
|
228
232
|
.on("message", data => {
|
|
229
233
|
console.log(data.toString());
|
|
230
234
|
})
|
|
231
|
-
.send("ws://localhost:8080/ws
|
|
235
|
+
.send("ws://localhost:8080/ws-init", 54)
|
|
232
236
|
.then(socket => {
|
|
233
237
|
socket.emit("test");
|
|
234
238
|
});
|