fullpwerr commited on
Commit
d2c5302
·
1 Parent(s): a171f6c
Files changed (1) hide show
  1. app.js +3 -1
app.js CHANGED
@@ -59,7 +59,9 @@ app.post("/upload", upload.single("file"), (req, res) => {
59
  const filePath = req.file.filename;
60
  const expiresAt = Date.now() + EXPIRATION_TIME;
61
  fileData[filePath] = expiresAt;
62
- fs.writeFileSync(META_FILE, JSON.stringify(fileData));
 
 
63
 
64
  res.json({
65
  success: true,
 
59
  const filePath = req.file.filename;
60
  const expiresAt = Date.now() + EXPIRATION_TIME;
61
  fileData[filePath] = expiresAt;
62
+ fs.writeFile(META_FILE, JSON.stringify(fileData, null, 2), (err) => {
63
+ if (err) console.error("Gagal menulis ke api.json:", err);
64
+ });
65
 
66
  res.json({
67
  success: true,