Initial commit
This commit is contained in:
commit
f4cf78603a
25 changed files with 2895 additions and 0 deletions
23
src/treetrail/attachments.py
Normal file
23
src/treetrail/attachments.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from treetrail.api_v1 import (get_attachment_tree_root,
|
||||
get_attachment_trail_root, get_attachment_poi_root)
|
||||
from treetrail.plantekey import get_thumbnail_root, get_img_root, get_img_type_root
|
||||
from treetrail.utils import mkdir
|
||||
|
||||
attachment_app = FastAPI()
|
||||
|
||||
attachment_app.mount("/plantekey/img", StaticFiles(directory=mkdir(get_img_root())),
|
||||
name="plantekey_img")
|
||||
attachment_app.mount("/plantekey/thumb", StaticFiles(directory=mkdir(get_thumbnail_root())),
|
||||
name="plantekey_thumb")
|
||||
attachment_app.mount("/plantekey/type", StaticFiles(directory=mkdir(get_img_type_root())),
|
||||
name="plantekey_type")
|
||||
|
||||
attachment_app.mount("/trail", StaticFiles(directory=mkdir(get_attachment_trail_root())),
|
||||
name="trail")
|
||||
attachment_app.mount("/tree", StaticFiles(directory=mkdir(get_attachment_tree_root())),
|
||||
name="tree")
|
||||
attachment_app.mount("/poi", StaticFiles(directory=mkdir(get_attachment_poi_root())),
|
||||
name="poi")
|
Loading…
Add table
Add a link
Reference in a new issue