mdaffin/timelapse

Add an endpoint to list images for a day

Closed this issue · 2 comments

/api/images/{day}

There should be a way to list all available images for a given day. Once #1 is done this should be as simple as using read_dir on one of day directories, formatting the results into a struct and serialising the results.

ebleb commented

Do you want the response to resemble a file system with clickable links or to only be a list of file names?

The response should be json - so nothing clickable but it should include the URL to the images so the front-end knows where to fetch them from. Something like:

[
  { "src": "/images/2020-10-01/17:01:08+01:00.png" },
  { "src": "/images/2020-10-01/17:01:08+01:00.png" },
  { "src": "/images/2020-10-01/17:01:08+01:00.png" },
  { "src": "/images/2020-10-01/17:01:08+01:00.png" }
]