API service which has a single REST endpoint that returns the last `N` historical results from the Postgres database table

Viewed 31

API service Has a single REST endpoint that returns the last N historical results from the database(Postgres). Example: GET /API/result?limit=3

 [
     {
       "timestamp": "2021-05-04T10:45:00",
       "status": true
     },
     {
       "timestamp": "2021-05-04T10:40:00",
       "status": false
     },
     {..}
 ]

I have stored the Timestamp and status of a website in Postgres via cron job, and I want to use API service to retrieve from the Postgres database table.

0 Answers
Related