Add documentation

This commit is contained in:
Alexandre Bodin 2019-08-12 17:08:22 +02:00
parent ac95603a12
commit d9f1f39ee4
2 changed files with 30 additions and 1 deletions

View File

@ -83,9 +83,36 @@ The `bootstrap` function is called at every server start. You can use it to add
Here are some use cases:
- Create an admin user if there isn't.
- Create an admin user if there isn't one.
- Fill the database with some necessary data.
- Check that the database is up-and-running.
- Load some envrionments variables.
The bootstrap function can be synchronous or asynchronous
**Synchronous**
```js
module.exports = () => {
// some sync code
};
```
**Return a promise**
```js
module.exports = () => {
return new Promise(/* some code */);
};
```
**Be async**
```js
module.exports = async () => {
await someSetup();
};
```
### CRON tasks

View File

@ -6,6 +6,8 @@
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*
* See more details here: https://strapi.io/documentation/3.0.0-beta.x/configurations/configurations.html#bootstrap
*/
module.exports = () => {};