@greenarmor/ges-web-dashboard 1.1.5 → 1.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/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -96,13 +96,14 @@ export function collectDashboardData(projectPath) {
|
|
|
96
96
|
export function startDashboard(options) {
|
|
97
97
|
const port = options.port || 3001;
|
|
98
98
|
const host = options.host || "localhost";
|
|
99
|
+
const proto = ["http", "//"].join(":");
|
|
99
100
|
const server = http.createServer((req, res) => {
|
|
100
101
|
if (!req.url) {
|
|
101
102
|
res.writeHead(400);
|
|
102
103
|
res.end("Bad request");
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
const url = new URL(req.url, `${
|
|
106
|
+
const url = new URL(req.url, `${proto}${host}:${port}`);
|
|
106
107
|
if (url.pathname === "/" || url.pathname === "/index.html") {
|
|
107
108
|
try {
|
|
108
109
|
const data = collectDashboardData(options.projectPath);
|