-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(types): import and use Context for boilerplate
- Loading branch information
1 parent
86170fe
commit d183196
Showing
4 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...rplate/midway-ts-ant-design-pro-boilerplate/boilerplate/server/src/app/controller/home.ts
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,10 +1,10 @@ | ||
import { controller, get, provide } from 'midway'; | ||
import { Context, controller, get, provide } from 'midway'; | ||
|
||
@provide() | ||
@controller('/') | ||
export class HomeController { | ||
@get('/') | ||
async index(ctx) { | ||
async index(ctx: Context) { | ||
await ctx.render('index'); | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...ages/midway-init/boilerplate/midway-ts-boilerplate/boilerplate/src/app/controller/home.ts
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,11 +1,11 @@ | ||
import { controller, get, provide } from 'midway'; | ||
import { Context, controller, get, provide } from 'midway'; | ||
|
||
@provide() | ||
@controller('/') | ||
export class HomeController { | ||
|
||
@get('/') | ||
async index(ctx) { | ||
async index(ctx: Context) { | ||
ctx.body = `Welcome to midwayjs!`; | ||
} | ||
} |
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