Procházet zdrojové kódy

- fixed html file path

Parad0x před 5 roky
rodič
revize
b735526d1a
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      app/src/web/HTTPServer.ts

+ 3 - 1
app/src/web/HTTPServer.ts

@@ -1,6 +1,7 @@
 import http from "http"
 import {URL} from "url"
 import fs from "fs"
+import path from "path"
 
 function parseAccept(head: string): string[]{
     let clientAccept = head.split(";");
@@ -17,7 +18,8 @@ function parseAccept(head: string): string[]{
     return acc;
 }
 
-const playerpage: string = fs.readFileSync("./obs/index.html", "utf8");
+const playerpage: string = fs.readFileSync(
+    path.join(__dirname, "../../obs/index.html"), "utf8");
 
 export class HTTPRequest{
     private req: http.IncomingMessage;