File tree Expand file tree Collapse file tree
backend/my_app_api/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
22
3- from fastapi import FastAPI
3+ from fastapi import FastAPI , Request
44from fastapi .middleware .cors import CORSMiddleware
55from fastapi_sqlalchemy import DBSessionMiddleware
6+ from fastapi .responses import RedirectResponse
7+ from starlette .datastructures import URL
68from my_app_api import __version__
79from my_app_api .settings import get_settings
810
3436 allow_headers = settings .CORS_ALLOW_HEADERS ,
3537)
3638
39+
40+ @app .get ("/" )
41+ def redirect (request : Request ):
42+ url = URL (
43+ path = '/ui/' ,
44+ query = request .url .components .query ,
45+ fragment = request .url .components .fragment ,
46+ )
47+ return RedirectResponse (url )
48+
3749app .include_router (touch_router )
Original file line number Diff line number Diff line change @@ -60,12 +60,14 @@ const makeClick = async () => {
6060 }
6161 clickResult .value = + data .count ;
6262};
63+
64+ const location = document .location .origin + " /docs/" ;
6365 </script >
6466
6567<template >
6668 <div >
6769 <h1 class =" text-h1" >
68- Hello <span v-if =" profileStore.full_name" >, {{ profileStore.full_name }}</span
70+ Привет <span v-if =" profileStore.full_name" >, {{ profileStore.full_name }}</span
6971 >!
7072 </h1 >
7173 <p v-if =" !profileStore.full_name" >
@@ -80,5 +82,8 @@ const makeClick = async () => {
8082 В сумме ты кликнул эту кнопку <span >{{ clickResult }}</span > раз
8183 </h2 >
8284 </div >
85+ <div >
86+ <p >Документация к этому коду находится по адресу <a href =" /docs/" >{{ location }}</a ></p >
87+ </div >
8388 </div >
8489</template >
You can’t perform that action at this time.
0 commit comments