Skip to content

Commit

Permalink
add /urls
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Oct 2, 2024
1 parent d08ca22 commit 35bdf37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions novel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ def do_GET(self):
}
response = json.dumps(filtered_titles)
self.wfile.write(response.encode("utf-8"))
elif self.path == "/urls":
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()

book_urls = {
name: BOOK_URL.replace("BOOK_ID", id) for id, name in books.items()
}
response = json.dumps(book_urls)
self.wfile.write(response.encode("utf-8"))
elif self.path == "/health":
if time.time() - last_updated_time > loop_time:
self.send_response(500)
Expand Down

0 comments on commit 35bdf37

Please sign in to comment.