Skip to content

Commit

Permalink
Change API URI format again
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jun 2, 2020
1 parent 039c374 commit d087e15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Expand Up @@ -7,6 +7,11 @@ Development
===========


2020-06-02 0.6.0
================
- Change API URI format again


2020-06-02 0.5.0
================
- Add "robots.txt" to HTTP API
Expand Down
14 changes: 7 additions & 7 deletions apicast/api.py
Expand Up @@ -33,13 +33,13 @@ def index():
</ul>
<h3>Index</h3>
<ul>
<li><a href="beeflight/germany/stations">List of federal states / sites</a></li>
<li><a href="beeflight/germany/stations/site-slugs">List of site slugs</a></li>
<li><a href="beeflight/stations/germany">List of federal states / sites</a></li>
<li><a href="beeflight/stations/germany/site-slugs">List of site slugs</a></li>
</ul>
<h3>Examples</h3>
<ul>
<li><a href="beeflight/germany/forecast/berlin_brandenburg/potsdam">Bee flight forecast for "berlin_brandenburg/potsdam"</a></li>
<li><a href="beeflight/germany/forecast/bayern/regensburg">Bee flight forecast for "bayern/regensburg"</a></li>
<li><a href="beeflight/forecast/germany/berlin_brandenburg/potsdam">Bee flight forecast for "berlin_brandenburg/potsdam"</a></li>
<li><a href="beeflight/forecast/germany/bayern/regensburg">Bee flight forecast for "bayern/regensburg"</a></li>
</ul>
</body>
</html>
Expand All @@ -54,19 +54,19 @@ def robots():
""".strip()


@app.get("/beeflight/germany/stations")
@app.get("/beeflight/stations/germany")
def beeflight_stations():
stations = dwd_beeflight_forecast_stations()
return make_response(stations)


@app.get("/beeflight/germany/stations/site-slugs")
@app.get("/beeflight/stations/germany/site-slugs")
def beeflight_stations_site_slugs():
slugs = dwd_beeflight_forecast_stations_site_slugs()
return make_response(slugs)


@app.get("/beeflight/germany/forecast/{state}/{site}")
@app.get("/beeflight/forecast/germany/{state}/{site}")
def beeflight_forecast_by_slug(state: str, site: str):
station_slug = f"{state}/{site}"

Expand Down

0 comments on commit d087e15

Please sign in to comment.