Download and extract the Colmena Starter
extensions folder of your Colmena installation.
lerna ls in the Colmena project root and verify that it lists the entry @colmena/module-api-starter
Open the file
apps/api/package.json and add this line to the
lerna bootstrapfrom the project root to link the new package to the API.
config/default.yamland add this line to the
colmena.modulesobject. This makes sure the API loads the new module.
colmena: modules: ... '@colmena/module-api-starter': true ...
Start the API by running
npm run dev:api from the project root.
If the module is installed successfully you should see this message:
[loopback-modules] Registering models from module: @colmena/module-api-starter
The starter kit comes with sample data. To load this data run:
npm run initdb
Please note that this will wipe any data from the development database!
Now that the endpoint is working we need to update the LoopBack SDK. This makes sure that the Admin Extension can easily consume the new endpoints.
In order to re-generate the LoopBack SDK run the following command from the project root:
npm run sdk
This will output a list of newly generated files. These files should be committed to the project as they describe the structure of the API.