Ryan Hull, 11/14/2023
The tool chosen for this assignemnt was LoopBack v4
- Install LoopBack v4 CLI
npm install -g @loopback/cli
- Create a new LoopBack project
lb4 app
- Test the new project
npm start
- Add a controller
lb4 controller
then selectREST Controller
and name ithello
- Test application
npm start
then navigate tohttp://localhost:3000/hello
- Create Todo model
lb4 model
then selectEntity
and name ittodo
- Create datasource
lb4 datasource
- Add db.json mock Database
touch src/data/db.json
then add some mock Todos - Add repository layer to perform CRUD operations
lb4 repository
then selectTodo
andIn-memory db (supported by @loopback/repository)
- Add controller to expose repository methods for Todos
lb4 controller
then selectREST Controller
and name ittodo
- Test application
npm start
then navigate tohttp://localhost:3000/todo
,http://localhost:3000/todo/1
, andhtto://localhost:3000/explorer
to see the generated Swagger Docs