mirror of
https://github.com/strapi/strapi.git
synced 2025-10-19 03:49:45 +00:00
Update controllers.md (#7829)
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
This commit is contained in:
parent
f8437184ca
commit
66bffcb84e
@ -7,7 +7,7 @@ Controllers are JavaScript files which contain a set of methods called **actions
|
|||||||
```js
|
```js
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// GET /hello
|
// GET /hello
|
||||||
index: async ctx => {
|
async index(ctx) {
|
||||||
return 'Hello World!';
|
return 'Hello World!';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -340,7 +340,7 @@ Our `index` action will return `Hello World!`. You can also return a JSON object
|
|||||||
```js
|
```js
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// GET /hello
|
// GET /hello
|
||||||
index: async ctx => {
|
async index(ctx) {
|
||||||
ctx.send('Hello World!');
|
ctx.send('Hello World!');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user