luoyutianyang commited on
Commit
c7ce038
·
verified ·
1 Parent(s): 4a260f7

Update egg-api.js

Browse files
Files changed (1) hide show
  1. 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
- app.listen(port, () => {
 
 
 
 
 
 
 
 
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
+ });