Added baseUrl from /src/

This commit is contained in:
Andrii Reinvald
2025-06-05 10:52:03 +02:00
parent 30a2136bc5
commit 412955c0af
12 changed files with 20 additions and 19 deletions
+2 -2
View File
@@ -3,8 +3,8 @@ import {IncomingHttpHeaders} from 'http';
import {displayRoute} from "./Display.js";
import {setupRoute} from "./Setup.js";
import {logRoute} from "./Log.js";
import {BYOS_DEVICE_MAC, BYOS_ENABLED} from "../Config.js";
import {ROUTE_BYOS_DISPLAY, ROUTE_BYOS_LOG, ROUTE_BYOS_SETUP} from "../Routes.js";
import {BYOS_DEVICE_MAC, BYOS_ENABLED} from "Config.js";
import {ROUTE_BYOS_DISPLAY, ROUTE_BYOS_LOG, ROUTE_BYOS_SETUP} from "Routes.js";
// all routes starts with /api/
export const BYOSRoutes = Router();
+2 -2
View File
@@ -4,9 +4,9 @@ import {
BYOS_DEVICE_ACCESS_TOKEN,
BYOS_PROXY,
REFRESH_RATE_SECONDS, SCREEN_URL,
} from "../Config.js";
} from "Config.js";
import {proxyDisplay} from "./Proxy.js";
import {checkImage, getScreenHash} from "../Screen/Screen.js";
import {checkImage, getScreenHash} from "Screen/Screen.js";
import {updateBattery} from "./Battery.js";
import {IncomingHttpHeaders} from "http";
+1 -1
View File
@@ -1,5 +1,5 @@
import {proxyLog} from "./Proxy.js";
import {BYOS_PROXY} from "../Config.js";
import {BYOS_PROXY} from "Config.js";
export async function logRoute(macId: string, accessToken: string, body: any) {
body['log']['logs_array'].map((record: any) => {
+1 -1
View File
@@ -1,4 +1,4 @@
import {BYOS_DEVICE_ACCESS_TOKEN, BYOS_PROXY} from "../Config.js";
import {BYOS_DEVICE_ACCESS_TOKEN, BYOS_PROXY} from "Config.js";
import {proxySetup} from "./Proxy.js";
export type SetupResponse = {
+1 -1
View File
@@ -1,4 +1,4 @@
import {TIMEZONE} from "../Config.js";
import {TIMEZONE} from "Config.js";
import {getHackerNews, HackerNewsData} from "./HackerNewsData.js";
export type TemplateDataType = {
+1 -1
View File
@@ -1,6 +1,6 @@
import {ReactNode} from "react";
import {renderToString} from "react-dom/server";
import {TemplateDataType} from "../Data/PrepareData.js";
import {TemplateDataType} from "Data/PrepareData.js";
export async function buildJSX(component: (props: any) => ReactNode, data: TemplateDataType): Promise<string> {
return renderToString(component(data));
+2 -2
View File
@@ -1,6 +1,6 @@
import {Liquid} from 'liquidjs';
import {TEMPLATE_FOLDER} from "../Config.js";
import {TemplateDataType} from "../Data/PrepareData.js";
import {TEMPLATE_FOLDER} from "Config.js";
import {TemplateDataType} from "Data/PrepareData.js";
const engine = new Liquid({
root: TEMPLATE_FOLDER,
+1 -1
View File
@@ -1,6 +1,6 @@
import puppeteer from "puppeteer";
import fs from 'fs/promises';
import {ASSETS_FOLDER} from "../Config.js";
import {ASSETS_FOLDER} from "Config.js";
export const BASE_URL_CHROME = 'http://localhost';
+3 -3
View File
@@ -1,7 +1,7 @@
import {prepareData, TemplateDataType} from "../Data/PrepareData.js";
import {prepareData, TemplateDataType} from "Data/PrepareData.js";
import {PNGto1BIT} from "./PNGto1BIT.js";
import {TEMPLATE_FOLDER} from "../Config.js";
import App from "../Template/JSX/App.js";
import {TEMPLATE_FOLDER} from "Config.js";
import App from "Template/JSX/App.js";
import {renderToImage} from "./RenderHTML.js";
import {buildLiquid} from "./BuildLiquid.js";
import {buildJSX} from "./BuildJSX.js";
+4 -4
View File
@@ -6,10 +6,10 @@ import {
BYOS_ENABLED,
REFRESH_RATE_SECONDS,
SCREEN_URL
} from "./Config.js";
import {buildScreen, checkImage, getScreenHash} from "./Screen/Screen.js";
import {BYOSRoutes} from "./BYOS/BYOSRoutes.js";
import {ROUTE_IMAGE, ROUTE_PLUGIN_REDIRECT} from "./Routes.js";
} from "Config.js";
import {buildScreen, checkImage, getScreenHash} from "Screen/Screen.js";
import {BYOSRoutes} from "BYOS/BYOSRoutes.js";
import {ROUTE_IMAGE, ROUTE_PLUGIN_REDIRECT} from "Routes.js";
const app = express();
app.use(express.json());
+1 -1
View File
@@ -1,4 +1,4 @@
import {TemplateDataType} from "../../Data/PrepareData.js";
import {TemplateDataType} from "Data/PrepareData.js";
import Time from "./Time.js";
import HackerNews from "./HackerNews.js";
+1
View File
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": "./src/",
"noEmit": true,
"target": "esnext",
"module": "nodenext",