working on obsidian plugin
This commit is contained in:
@@ -161,6 +161,7 @@ export function createServer(customSiteDir, customPostsDir, customAssetsDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
fs.mkdirSync(postsDir, { recursive: true });
|
||||
fs.mkdirSync(assetsDir, { recursive: true });
|
||||
|
||||
@@ -186,6 +187,11 @@ export function createServer(customSiteDir, customPostsDir, customAssetsDir) {
|
||||
slug: cleanSlug,
|
||||
path: `/posts/${cleanSlug}/`
|
||||
}));
|
||||
} catch (writeErr) {
|
||||
console.error("[Ingestion API] Error saving post/assets:", writeErr);
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: `Failed to write file to disk: ${writeErr.message}` }));
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user