Polish project documentation and runtime config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import http from "node:http";
|
||||
import { spawn } from "node:child_process";
|
||||
import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
function readEnvKey(path, key) {
|
||||
const txt = readFileSync(path, "utf8");
|
||||
@@ -62,8 +63,10 @@ async function wait(ms) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const key = readEnvKey("/Users/xuexue/new2/.env", "AMAP_JS_KEY");
|
||||
const security = readEnvKey("/Users/xuexue/new2/.env", "AMAP_SECURITY_JSCODE");
|
||||
const root = path.resolve(new URL("..", import.meta.url).pathname, "..");
|
||||
const envPath = process.env.TRAVEL_KG_ENV_PATH || path.join(root, ".env");
|
||||
const key = readEnvKey(envPath, "AMAP_JS_KEY");
|
||||
const security = readEnvKey(envPath, "AMAP_SECURITY_JSCODE");
|
||||
if (!key || !security) throw new Error("missing AMap JS key/security");
|
||||
|
||||
const chrome = spawn(
|
||||
|
||||
Reference in New Issue
Block a user