File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 16
16
from futuramaapi .middlewares .cors import CORSMiddleware
17
17
from futuramaapi .middlewares .secure import HTTPSRedirectMiddleware
18
18
from futuramaapi .repositories .session import session_manager
19
+ from futuramaapi .utils ._compat import metadata
19
20
20
21
if TYPE_CHECKING :
22
+ from pydantic import HttpUrl
21
23
from starlette .routing import Route , WebSocketRoute
22
24
23
25
mimetypes .add_type ("image/webp" , ".webp" )
@@ -51,6 +53,12 @@ def _init_sentry() -> None:
51
53
profiles_sample_rate = settings .sentry .profiles_sample_rate ,
52
54
)
53
55
56
+ @property
57
+ def description (self ):
58
+ summary : str = metadata ["summary" ]
59
+ project_url : HttpUrl = settings .build_url (is_static = False )
60
+ return f"{ summary } [Go back home]({ project_url } )."
61
+
54
62
@abstractmethod
55
63
def get_app (
56
64
self ,
@@ -73,6 +81,7 @@ def get_app(
73
81
redoc_url = None ,
74
82
lifespan = lifespan ,
75
83
version = self .version ,
84
+ description = self .description ,
76
85
)
77
86
78
87
def _add_middlewares (self ) -> None :
You can’t perform that action at this time.
0 commit comments