mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
answer realpath from cache instead of round-tripping to the server
This commit is contained in:
@@ -392,22 +392,6 @@ router.get("/access", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get("/realpath", async (req, res) => {
|
||||
const resolved = guardPath(req, res);
|
||||
|
||||
if (!resolved) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const real = await fs.promises.realpath(resolved);
|
||||
|
||||
res.json({ path: path.relative(req._vaultRoot, real) });
|
||||
} catch (e) {
|
||||
res.status(500).json({ error: e.code || "internal", code: e.code });
|
||||
}
|
||||
});
|
||||
|
||||
// POST /api/fs/utimes { path, atime, mtime, vault? }
|
||||
router.post("/utimes", async (req, res) => {
|
||||
const resolved = guardPath(req, res, "body");
|
||||
|
||||
Reference in New Issue
Block a user