fix
This commit is contained in:
parent
ec75bd048c
commit
17671ec0e4
|
|
@ -49,6 +49,7 @@ export const initLive = async (p: PG, domain: string) => {
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
location.hostname === "prasi.app" ||
|
location.hostname === "prasi.app" ||
|
||||||
|
location.hostname === "prasi.web.andromedia.co.id" ||
|
||||||
location.hostname === "localhost" ||
|
location.hostname === "localhost" ||
|
||||||
location.hostname === "127.0.0.1" ||
|
location.hostname === "127.0.0.1" ||
|
||||||
location.hostname === "10.0.2.2" // android localhost
|
location.hostname === "10.0.2.2" // android localhost
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ addEventListener("message", async (e) => {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "define-route":
|
case "define-route":
|
||||||
console.log("defining route", e.data.routes);
|
|
||||||
g.router = createRouter({ strictTrailingSlash: false });
|
g.router = createRouter({ strictTrailingSlash: false });
|
||||||
for (const route of e.data.routes) {
|
for (const route of e.data.routes) {
|
||||||
g.router.insert(route.url, route);
|
g.router.insert(route.url, route);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"dev": "bun clean && bun run --silent --watch ./pkgs/core/index.ts dev",
|
"dev": "bun clean && bun run --silent --watch ./pkgs/core/index.ts dev",
|
||||||
"clean": "rm -rf app/static && rm -rf app/web/.parcel-cache",
|
"clean": "rm -rf app/static && rm -rf app/web/.parcel-cache",
|
||||||
"build": "bun run --silent ./pkgs/core/build.ts",
|
"build": "bun run --silent ./pkgs/core/build.ts",
|
||||||
"db-pull": "bun run --silent ./pkgs/core/db-pull.ts",
|
"db-pull": "bun run ./pkgs/core/db-pull.ts",
|
||||||
"prod": "bun run --silent ./pkgs/core/index.ts",
|
"prod": "bun run --silent ./pkgs/core/index.ts",
|
||||||
"local-prod": "bun run build && bun run db-pull && bun run ./pkgs/core/index.ts",
|
"local-prod": "bun run build && bun run db-pull && bun run ./pkgs/core/index.ts",
|
||||||
"pull": "cd app/db && bun prisma db pull && bun prisma generate",
|
"pull": "cd app/db && bun prisma db pull && bun prisma generate",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
|
import { spawn } from "bun";
|
||||||
import { dir } from "dir";
|
import { dir } from "dir";
|
||||||
import { $ } from "execa";
|
|
||||||
|
|
||||||
await $({
|
await spawn({
|
||||||
|
cmd: ["bun", "prisma", "db", "pull"],
|
||||||
cwd: dir.path("app/db"),
|
cwd: dir.path("app/db"),
|
||||||
stdio: ["ignore", "inherit", "inherit"],
|
stdio: ["ignore", "inherit", "inherit"],
|
||||||
})`bun prisma db pull`;
|
}).exited;
|
||||||
await $({
|
|
||||||
|
await spawn({
|
||||||
|
cmd: ["bun", "prisma", "generate"],
|
||||||
cwd: dir.path("app/db"),
|
cwd: dir.path("app/db"),
|
||||||
stdio: ["ignore", "inherit", "inherit"],
|
stdio: ["ignore", "inherit", "inherit"],
|
||||||
})`bun prisma generate`;
|
}).exited;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ export const createServer = async () => {
|
||||||
} as WebSocketHandler<WSData>,
|
} as WebSocketHandler<WSData>,
|
||||||
async fetch(req, server) {
|
async fetch(req, server) {
|
||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
console.log(req.url);
|
|
||||||
|
|
||||||
if (wsHandler[url.pathname]) {
|
if (wsHandler[url.pathname]) {
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue