Seeding the database
Database seeding refers to the process of populating the database with data—this can be data required for the initial application setup or just sample data for demonstration purposes. This process is usually done when the application starts for the first time. Luckily for us, Strapi comes with a bootstrap
lifecycle function that is executed every time the server starts. This function is located in the src/index.js
file. Let's open this file and, for now, just print a simple hello world message, as follows:
Bootstrap(/*{strapi}*/){ strapi.log.info("Hello World"); };
Once you have saved this simple change, the server will restart, and you should see a simple Hello World
message printed on the screen, as follows:
In Chapter 7, Authentication and Authorization in Strapi, we created three roles for our API (short for application programming...