diff --git a/app/src/server.ts b/app/main.ts similarity index 90% rename from app/src/server.ts rename to app/main.ts index 19f85c8..87d011f 100644 --- a/app/src/server.ts +++ b/app/main.ts @@ -6,14 +6,14 @@ import esbuild from "esbuild"; async function main() { const port = Number(process.env.PORT ?? "8080"); const apiUrl = process.env.QUOT_API_URL || "http://127.0.0.1:3000"; - const publicDir = __dirname; - const htmlPath = `${publicDir}/index.html`; - const scriptPath = `${publicDir}/index.ts`; + const viewsDir = `${__dirname}/views`; + const htmlPath = `${viewsDir}/index.html`; + const scriptPath = `${viewsDir}/index.ts`; const result = await esbuild.serve( { host: "127.0.0.1", - servedir: publicDir, + servedir: viewsDir, }, { bundle: true, diff --git a/app/package.json b/app/package.json index 477e025..ad52c5c 100644 --- a/app/package.json +++ b/app/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "test": "tsc --noEmit", - "start": "node -r esbuild-register src/server.ts" + "start": "node -r esbuild-register main.ts" }, "engines": { "node": "^18.7.0" diff --git a/app/src/protocol/pages.ts b/app/protocol/pages.ts similarity index 100% rename from app/src/protocol/pages.ts rename to app/protocol/pages.ts diff --git a/app/src/app.css b/app/views/app.css similarity index 100% rename from app/src/app.css rename to app/views/app.css diff --git a/app/src/app.tsx b/app/views/app.tsx similarity index 100% rename from app/src/app.tsx rename to app/views/app.tsx diff --git a/app/src/components/card.css b/app/views/components/card.css similarity index 100% rename from app/src/components/card.css rename to app/views/components/card.css diff --git a/app/src/components/card.tsx b/app/views/components/card.tsx similarity index 100% rename from app/src/components/card.tsx rename to app/views/components/card.tsx diff --git a/app/src/components/cards.css b/app/views/components/cards.css similarity index 100% rename from app/src/components/cards.css rename to app/views/components/cards.css diff --git a/app/src/components/cards.tsx b/app/views/components/cards.tsx similarity index 100% rename from app/src/components/cards.tsx rename to app/views/components/cards.tsx diff --git a/app/src/components/editor.css b/app/views/components/editor.css similarity index 100% rename from app/src/components/editor.css rename to app/views/components/editor.css diff --git a/app/src/components/editor.tsx b/app/views/components/editor.tsx similarity index 96% rename from app/src/components/editor.tsx rename to app/views/components/editor.tsx index 1fe128c..94539ea 100644 --- a/app/src/components/editor.tsx +++ b/app/views/components/editor.tsx @@ -7,7 +7,7 @@ import { } from "lexical"; import { registerPlainText } from "@lexical/plain-text"; import { onCleanup, onMount } from "solid-js"; -import type Pages from "../protocol/pages"; +import type Pages from "../../protocol/pages"; import "./editor.css"; const editor = createEditor(); diff --git a/app/src/env.d.ts b/app/views/env.d.ts similarity index 100% rename from app/src/env.d.ts rename to app/views/env.d.ts diff --git a/app/src/helpers/beforeunload.ts b/app/views/helpers/beforeunload.ts similarity index 100% rename from app/src/helpers/beforeunload.ts rename to app/views/helpers/beforeunload.ts diff --git a/app/src/helpers/random.ts b/app/views/helpers/random.ts similarity index 100% rename from app/src/helpers/random.ts rename to app/views/helpers/random.ts diff --git a/app/src/helpers/throttle.ts b/app/views/helpers/throttle.ts similarity index 100% rename from app/src/helpers/throttle.ts rename to app/views/helpers/throttle.ts diff --git a/app/src/index.html b/app/views/index.html similarity index 100% rename from app/src/index.html rename to app/views/index.html diff --git a/app/src/index.ts b/app/views/index.ts similarity index 100% rename from app/src/index.ts rename to app/views/index.ts diff --git a/app/src/pages/index.tsx b/app/views/pages/index.tsx similarity index 93% rename from app/src/pages/index.tsx rename to app/views/pages/index.tsx index ce669f3..63f3ff7 100644 --- a/app/src/pages/index.tsx +++ b/app/views/pages/index.tsx @@ -1,5 +1,5 @@ import { createResource, For } from "solid-js"; -import type Pages from "../protocol/pages"; +import type Pages from "../../protocol/pages"; import Cards from "../components/cards"; import Card from "../components/card"; diff --git a/app/src/pages/page.tsx b/app/views/pages/page.tsx similarity index 97% rename from app/src/pages/page.tsx rename to app/views/pages/page.tsx index 35c3736..d4bac2b 100644 --- a/app/src/pages/page.tsx +++ b/app/views/pages/page.tsx @@ -1,5 +1,5 @@ import { createResource } from "solid-js"; -import type Pages from "../protocol/pages"; +import type Pages from "../../protocol/pages"; import Editor from "../components/editor"; import beforeunload from "../helpers/beforeunload"; import throttle from "../helpers/throttle";