Endpoint to list all notes
We’ll have to list all our notes. We’ll use GET method as we’ll use it to retrieve data from server.
- Go to workspace page and select “new endpoint”.
- Name the endpoint as “listNotes” and url as “/notes/list/”.
- We’ll use GET method here as we want to retrieve data.
- Select “save” to create your endpoint.
- Now we’ll use fetch Many block to get all the notes.
- Add variable name as “note”.
- Drag and drop a “database fetch many” block and select “note” table in table name and select “all” under filter data and name the variable as “notes”.
- And save the block.
- drag and drop a response block and select 200 status code to send a success response and save the response block.
- Deploy the project
# Test it out
- Once the project is launched in browser, you will see your previously created note int the list.
- Next we’ll create endpoint to edit note that we created.....
# Next steps
Now lets make an endpoint to edit notes. See Build endpoint to edit notes