Update controllers.md (#7829)

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
This commit is contained in:
Mattias van den Belt 2020-09-11 18:26:42 +02:00 committed by GitHub
parent f8437184ca
commit 66bffcb84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ Controllers are JavaScript files which contain a set of methods called **actions
```js
module.exports = {
// GET /hello
index: async ctx => {
async index(ctx) {
return 'Hello World!';
},
};
@ -340,7 +340,7 @@ Our `index` action will return `Hello World!`. You can also return a JSON object
```js
module.exports = {
// GET /hello
index: async ctx => {
async index(ctx) {
ctx.send('Hello World!');
},
};