@b9g/platform-node 0.1.7 → 0.1.8
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 +2 -3
- package/src/index.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b9g/platform-node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Node.js platform adapter for Shovel with hot reloading and ESBuild integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shovel",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"esbuild"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@b9g/platform": "^0.1.
|
|
15
|
-
"@b9g/cache": "^0.1.4"
|
|
14
|
+
"@b9g/platform": "^0.1.6"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
17
|
"@b9g/libuild": "^0.1.11",
|
package/src/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createCacheFactory
|
|
9
9
|
} from "@b9g/platform";
|
|
10
10
|
import { CustomCacheStorage } from "@b9g/cache";
|
|
11
|
-
import * as
|
|
11
|
+
import * as HTTP from "http";
|
|
12
12
|
import * as Path from "path";
|
|
13
13
|
import { getLogger } from "@logtape/logtape";
|
|
14
14
|
var logger = getLogger(["platform-node"]);
|
|
@@ -197,7 +197,7 @@ var NodePlatform = class extends BasePlatform {
|
|
|
197
197
|
createServer(handler, options = {}) {
|
|
198
198
|
const port = options.port ?? this.#options.port;
|
|
199
199
|
const host = options.host ?? this.#options.host;
|
|
200
|
-
const httpServer =
|
|
200
|
+
const httpServer = HTTP.createServer(async (req, res) => {
|
|
201
201
|
try {
|
|
202
202
|
const url = `http://${req.headers.host}${req.url}`;
|
|
203
203
|
const request = new Request(url, {
|