@nmtjs/http-transport 0.1.6 → 0.1.7
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/dist/lib/transport.js +3 -9
- package/dist/lib/transport.js.map +1 -1
- package/lib/transport.ts +3 -9
- package/package.json +6 -6
package/dist/lib/transport.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createTransport } from '@nmtjs/application';
|
|
2
2
|
import { HttpTransportServer } from "./server.js";
|
|
3
|
-
export const HttpTransport =
|
|
4
|
-
|
|
5
|
-
app.hooks.add(Hook.OnStartup, async ()=>{
|
|
6
|
-
await server.start();
|
|
7
|
-
});
|
|
8
|
-
app.hooks.add(Hook.OnShutdown, async ()=>{
|
|
9
|
-
await server.stop();
|
|
10
|
-
});
|
|
3
|
+
export const HttpTransport = createTransport('HttpTransport', (app, options)=>{
|
|
4
|
+
return new HttpTransportServer(app, options);
|
|
11
5
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/transport.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../lib/transport.ts"],"sourcesContent":["import { createTransport } from '@nmtjs/application'\nimport { HttpTransportServer } from './server.ts'\nimport type { HttpTransportOptions } from './types.ts'\n\nexport const HttpTransport = createTransport<HttpTransportOptions>(\n 'HttpTransport',\n (app, options) => {\n return new HttpTransportServer(app, options)\n },\n)\n"],"names":["createTransport","HttpTransportServer","HttpTransport","app","options"],"mappings":"AAAA,SAASA,eAAe,QAAQ,qBAAoB;AACpD,SAASC,mBAAmB,QAAQ,cAAa;AAGjD,OAAO,MAAMC,gBAAgBF,gBAC3B,iBACA,CAACG,KAAKC;IACJ,OAAO,IAAIH,oBAAoBE,KAAKC;AACtC,GACD"}
|
package/lib/transport.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createTransport } from '@nmtjs/application'
|
|
2
2
|
import { HttpTransportServer } from './server.ts'
|
|
3
3
|
import type { HttpTransportOptions } from './types.ts'
|
|
4
4
|
|
|
5
|
-
export const HttpTransport =
|
|
5
|
+
export const HttpTransport = createTransport<HttpTransportOptions>(
|
|
6
6
|
'HttpTransport',
|
|
7
7
|
(app, options) => {
|
|
8
|
-
|
|
9
|
-
app.hooks.add(Hook.OnStartup, async () => {
|
|
10
|
-
await server.start()
|
|
11
|
-
})
|
|
12
|
-
app.hooks.add(Hook.OnShutdown, async () => {
|
|
13
|
-
await server.stop()
|
|
14
|
-
})
|
|
8
|
+
return new HttpTransportServer(app, options)
|
|
15
9
|
},
|
|
16
10
|
)
|
package/package.json
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.
|
|
11
|
+
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.49.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@nmtjs/application": "^0.
|
|
15
|
-
"@nmtjs/common": "^0.
|
|
14
|
+
"@nmtjs/application": "^0.4.2s",
|
|
15
|
+
"@nmtjs/common": "^0.4.2s"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@nmtjs/application": "^0.
|
|
19
|
-
"@nmtjs/common": "^0.
|
|
18
|
+
"@nmtjs/application": "^0.4.2s",
|
|
19
|
+
"@nmtjs/common": "^0.4.2s",
|
|
20
20
|
"@types/node": "^18.0.0"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"LICENSE.md",
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
|
-
"version": "0.1.
|
|
33
|
+
"version": "0.1.7",
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "neemata-build ./index.ts './lib/**/*.ts'",
|
|
36
36
|
"type-check": "tsc --noEmit"
|