fastify-txstate 3.0.0 → 3.0.1
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/lib/index.js +3 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -109,7 +109,7 @@ class Server {
|
|
|
109
109
|
var _a;
|
|
110
110
|
const customPort = port !== null && port !== void 0 ? port : parseInt((_a = process.env.PORT) !== null && _a !== void 0 ? _a : '0');
|
|
111
111
|
if (customPort) {
|
|
112
|
-
await this.app.listen(customPort, '0.0.0.0');
|
|
112
|
+
await this.app.listen({ port: customPort, host: '0.0.0.0' });
|
|
113
113
|
}
|
|
114
114
|
else if (this.https) {
|
|
115
115
|
// redirect 80 to 443
|
|
@@ -118,10 +118,10 @@ class Server {
|
|
|
118
118
|
res.writeHead(301, { Location: 'https://' + ((_c = (_b = (_a = req === null || req === void 0 ? void 0 : req.headers) === null || _a === void 0 ? void 0 : _a.host) === null || _b === void 0 ? void 0 : _b.replace(/:\d+$/, '')) !== null && _c !== void 0 ? _c : '') + ((_d = req.url) !== null && _d !== void 0 ? _d : '') });
|
|
119
119
|
res.end();
|
|
120
120
|
}).listen(80);
|
|
121
|
-
await this.app.listen(443, '0.0.0.0');
|
|
121
|
+
await this.app.listen({ port: 443, host: '0.0.0.0' });
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
124
|
-
await this.app.listen(80, '0.0.0.0');
|
|
124
|
+
await this.app.listen({ port: 80, host: '0.0.0.0' });
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
addErrorHandler(handler) {
|