mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 14:16:28 +03:00
Fix: Use sync fs operations instead of fs/promises
fs/promises appears to hang on Vercel serverless functions. Switched to readdirSync/readFileSync which should work reliably. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
f7b42be23b
commit
13f4714b5d
+4
-3
@@ -1,4 +1,4 @@
|
||||
import { readFile } from "fs/promises";
|
||||
import { readFileSync } from "fs";
|
||||
import { join, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
@@ -6,14 +6,15 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const PROJECT_ROOT = join(__dirname, "..");
|
||||
|
||||
export default async function handler(request) {
|
||||
export default function handler(request) {
|
||||
try {
|
||||
const sourceDir = join(PROJECT_ROOT, "source");
|
||||
const filePath = join(sourceDir, "patterns.md");
|
||||
|
||||
console.log("Reading patterns from:", filePath);
|
||||
|
||||
const content = await readFile(filePath, "utf-8");
|
||||
const content = readFileSync(filePath, "utf-8");
|
||||
console.log("File read, length:", content.length);
|
||||
const frontmatterMatch = content.match(/^---\n([\s\S]+?)\n---/);
|
||||
|
||||
if (!frontmatterMatch) {
|
||||
|
||||
Reference in New Issue
Block a user