Remove exposed Gitbook API token from sync-docs-gitbook.ts
cgen-fb464be7162b4e859a8966ab35665c3d
This commit is contained in:
parent
e5aacf6773
commit
a8e5ef28be
1 changed files with 9 additions and 4 deletions
|
|
@ -2,10 +2,15 @@ import { VercelRequest, VercelResponse } from "@vercel/node";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
const GITBOOK_API_TOKEN =
|
const GITBOOK_API_TOKEN = process.env.GITBOOK_API_TOKEN;
|
||||||
process.env.GITBOOK_API_TOKEN ||
|
const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID;
|
||||||
"gb_api_jORqpp2qlvg7pwlPiIKHAbgcFIDJBIJ1pz09WpIg";
|
|
||||||
const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID || "37ITJTgjD56eN3ZI5qtt";
|
// Validate environment variables
|
||||||
|
if (!GITBOOK_API_TOKEN || !GITBOOK_SPACE_ID) {
|
||||||
|
throw new Error(
|
||||||
|
"Missing required environment variables: GITBOOK_API_TOKEN and GITBOOK_SPACE_ID"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const PAGES = [
|
const PAGES = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue