Spaces:
Running
Running
fix exp
Browse files
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.
|
|
|
|
|
|
|
| 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,
|