-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,914 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | ||
} |
Oops, something went wrong.