Spaces:
Runtime error
Runtime error
Update egg-api.js
Browse files- egg-api.js +11 -3
egg-api.js
CHANGED
|
@@ -137,7 +137,15 @@ app.get('/process-image', async (req, res) => {
|
|
| 137 |
}
|
| 138 |
}
|
| 139 |
});
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
console.log(`Server is running on http://localhost:${port}`);
|
| 143 |
-
});
|
|
|
|
| 137 |
}
|
| 138 |
}
|
| 139 |
});
|
| 140 |
+
|
| 141 |
+
// 记录使用次数和内存占用的全局变量
|
| 142 |
+
let usageCount = 0;
|
| 143 |
+
let memoryUsage = 0;
|
| 144 |
+
|
| 145 |
+
app.get('/', (req, res) => {
|
| 146 |
+
res.json({ usageCount, memoryUsage });
|
| 147 |
+
});
|
| 148 |
+
|
| 149 |
+
app.listen(port, () => {
|
| 150 |
console.log(`Server is running on http://localhost:${port}`);
|
| 151 |
+
});
|