mirror of
https://github.com/usetrmnl/byos_node_lite.git
synced 2026-08-13 23:18:18 -07:00
Added baseUrl from /src/
This commit is contained in:
@@ -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
@@ -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
@@ -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
@@ -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,4 +1,4 @@
|
||||
import {TIMEZONE} from "../Config.js";
|
||||
import {TIMEZONE} from "Config.js";
|
||||
import {getHackerNews, HackerNewsData} from "./HackerNewsData.js";
|
||||
|
||||
export type TemplateDataType = {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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,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';
|
||||
|
||||
|
||||
@@ -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
@@ -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,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,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src/",
|
||||
"noEmit": true,
|
||||
"target": "esnext",
|
||||
"module": "nodenext",
|
||||
|
||||
Reference in New Issue
Block a user