fix: use explicit durable bridge entrypoint
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
||||
import { mkdtempSync, readFileSync, realpathSync, rmSync } from "node:fs";
|
||||
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
||||
import { mkdir, open, readFile, readdir, rename, stat, unlink } from "node:fs/promises";
|
||||
import { createServer } from "node:http";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
export function createGithubSyncHandler(config) {
|
||||
const controller = config.controller ?? createDurableSyncController(config);
|
||||
@@ -1358,14 +1357,3 @@ function positiveIntegerEnv(name) {
|
||||
if (!Number.isFinite(value) || value < 1) throw new Error(`invalid positive integer env ${name}`);
|
||||
return value;
|
||||
}
|
||||
|
||||
export function isMainModule(argvPath = process.argv[1], moduleUrl = import.meta.url) {
|
||||
if (!argvPath) return false;
|
||||
try {
|
||||
return pathToFileURL(realpathSync(argvPath)).href === pathToFileURL(realpathSync(new URL(moduleUrl))).href;
|
||||
} catch {
|
||||
return pathToFileURL(argvPath).href === moduleUrl;
|
||||
}
|
||||
}
|
||||
|
||||
if (isMainModule()) startServer();
|
||||
|
||||
Reference in New Issue
Block a user