Skip to content

Commit

Permalink
Merge branch 'master' of github.com:joesonw/ts-router
Browse files Browse the repository at this point in the history
  • Loading branch information
joesonw committed Feb 29, 2016
2 parents be6254d + f7b1516 commit dc14036
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class UserRoute extends Controller {

constructor() {
super();
//The controller will be created upon each request, so it is safe to initialize variables here for all other routes.
this.user = getFromMemoryCache();
}

@Before
async getUserBeforeAll(@PathParam('_id') userId:string) {
this.userId = await dbAction({_id: this.userId});
this.user = await dbAction({_id: this.userId});
}

@Path('/:_id')
Expand Down

0 comments on commit dc14036

Please sign in to comment.