Skip to content

Commit

Permalink
add code
Browse files Browse the repository at this point in the history
  • Loading branch information
applejian committed Nov 18, 2021
1 parent 8997c3a commit e9f0a00
Show file tree
Hide file tree
Showing 23 changed files with 1,914 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 11/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const Koa = require('koa');
const app = new Koa();
const routerMiddleware = require('./src/middleware/router');
//const routerMiddleware = require('./src/middleware/newRouter');
const logCenter = require('./src/middleware/logCenter');
const session = require('./src/middleware/session');

const dumpFun = require('./src/lib/heapdump');

app.use(logCenter());
app.use(session());
app.use(routerMiddleware());

app.listen(3000, () => console.log(`Example app listening on port 3000!`));

/// 为了方便,可以打开如下代码自动获取
const currentDate = new Date();
dumpFun('nodejs-cloumn', `${currentDate.getHours()}:${currentDate.getMinutes()+1}`, 60);
5 changes: 5 additions & 0 deletions 11/bin/send_request.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ApiCenter = require('../src/core/apiCenter');

for(let i=500; i<1000; i++){
ApiCenter.callApi(`http://127.0.0.1:3000/v1/test?username=${i}`);
}
Loading

0 comments on commit e9f0a00

Please sign in to comment.