Parad0x 5 роки тому
батько
коміт
b735526d1a
1 змінених файлів з 3 додано та 1 видалено
  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;