August 2016
Intermediate to advanced
376 pages
6h 33m
English
Boot files are very important in applications using a LoopBack framework. These files are started when the application is executed, and can perform various kinds of task.
The application already has all the endpoints that it needs. So, let's see how to create a boot file and use another feature from the LoopBack framework to migrate our models to the database.
In this example, we will see how to use the automigrate function to insert some content in the database at the time we start the application:
You can read more about the LoopBack API at http://apidocs.strongloop.com/.
Inside server/boot, create a new file called create-sample-models.js and place the following content in it:
module.exports = function(app) { ...