-
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.
test: add router for bench cases (eggjs#78)
* test: add router for bench cases * chore: remove postinstall
- Loading branch information
1 parent
711f9c0
commit 091bf58
Showing
7 changed files
with
73 additions
and
52 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 |
---|---|---|
|
@@ -9,6 +9,7 @@ module.exports = { | |
'test/fixtures', | ||
'examples', | ||
'benchmarks', | ||
"docs", | ||
], | ||
devdep: [ | ||
'autod', | ||
|
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
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
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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
'use strict'; | ||
|
||
const toa = require('toa'); | ||
const Router = require('toa-router'); | ||
|
||
const router = new Router(); | ||
const app = toa(); | ||
let n = 10; | ||
let n = 15; | ||
|
||
while (n--) { | ||
app.use(function* (next) { | ||
yield next; | ||
}); | ||
} | ||
|
||
app.use(function* () { | ||
router.get('/', function* () { | ||
this.body = 'Hello World, toa'; | ||
}); | ||
|
||
app.use(router.toThunk()); | ||
console.log('toa app listen on 7003'); | ||
app.listen(7003); |
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
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
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