Update server.js
Browse files
server.js
CHANGED
|
@@ -10,15 +10,15 @@ const stringify = (value) => {
|
|
| 10 |
return JSON.stringify(value, null, 2)
|
| 11 |
}
|
| 12 |
|
| 13 |
-
const
|
| 14 |
|
| 15 |
app.use((req, res, next) => {
|
| 16 |
-
|
| 17 |
-
|
| 18 |
});
|
| 19 |
|
| 20 |
app.all('/', async(req, res) => {
|
| 21 |
-
res.json({ uptime: new Date(process.uptime() * 1000).toUTCString().split(' ')[4],
|
| 22 |
})
|
| 23 |
|
| 24 |
app.all('/search', async(req, res) => {
|
|
|
|
| 10 |
return JSON.stringify(value, null, 2)
|
| 11 |
}
|
| 12 |
|
| 13 |
+
const totalRequest = 0
|
| 14 |
|
| 15 |
app.use((req, res, next) => {
|
| 16 |
+
totalRequest += 1;
|
| 17 |
+
next();
|
| 18 |
});
|
| 19 |
|
| 20 |
app.all('/', async(req, res) => {
|
| 21 |
+
res.json({ uptime: new Date(process.uptime() * 1000).toUTCString().split(' ')[4], totalRequest })
|
| 22 |
})
|
| 23 |
|
| 24 |
app.all('/search', async(req, res) => {
|