Skip to content

Commit ab817bd

Browse files
committed
add sources
1 parent 85e493f commit ab817bd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/main.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from . import models
1717
from .core import create_app
18-
from .data import data_source
18+
from .data import data_source, data_sources
1919

2020
# ################
2121
# Dependencies
@@ -123,6 +123,16 @@ def get_location_by_id(request: fastapi.Request, id: int, timelines: int = 1):
123123
return {"location": request.state.source.get(id).serialize(timelines)}
124124

125125

126+
@APP.get('/sources')
127+
async def sources():
128+
"""
129+
Retrieves a list of data-sources that are availble to use.
130+
"""
131+
return {
132+
'sources': list(data_sources.keys())
133+
}
134+
135+
126136
# mount the existing Flask app
127137
# v1 @ /
128138
# v2 @ /v2

0 commit comments

Comments
 (0)