Skip to content

Commit dbb34bd

Browse files
committed
Added links to homepage to API docs.
1 parent 2005e66 commit dbb34bd

File tree

5 files changed

+35
-46
lines changed

5 files changed

+35
-46
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"python.pythonPath": "/home/blevinscm/src/fastapi-scaffold-base/env/bin/python3.9"
2+
"python.pythonPath": "env/bin/python"
33
}

app/main.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
from fastapi import requests
2+
from app.routers.hugs import Hug
13
from fastapi import Request, FastAPI, Header, HTTPException
24
from fastapi.templating import Jinja2Templates
35
from fastapi.responses import HTMLResponse
4-
from fastapi.staticfiles import StaticFiles
6+
from fastapi.staticfiles import StaticFiles
57
from .routers import hugs
68

79

10+
811
templates = Jinja2Templates(directory="templates")
912

13+
1014
tags_metadata = [
1115
{
1216
"name": "hugs",
@@ -22,11 +26,12 @@
2226
openapi_tags=tags_metadata,
2327
title="The super duper Hugs API",
2428
description="This is an example for the base project Generator",
25-
version="0.0.0.0.0.0.1",
29+
version="v0.0.1",
2630

2731
)
2832

2933

34+
3035
async def get_token_header(x_token: str = Header(...)):
3136
if x_token != "fake-super-secret-token":
3237
raise HTTPException(status_code=400, detail="X-Token header invalid")
@@ -35,7 +40,7 @@ async def get_token_header(x_token: str = Header(...)):
3540
app.include_router(hugs.router)
3641
app.mount("/static", StaticFiles(directory="static"), name="static")
3742

38-
@app.get("/")
43+
@app.get("/", response_class=HTMLResponse)
3944
async def serve_home(request: Request):
4045
return templates.TemplateResponse("index.html", {"request": request})
4146

requirements.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,23 @@ pydantic==1.7.2
3030
pymongo==3.11.0
3131
starlette==0.13.6
3232
uvicorn==0.12.2
33+
aiofiles==0.6.0
34+
aniso8601==7.0.0
35+
click==7.1.2
36+
fastapi==0.61.2
37+
graphene==2.1.8
38+
graphql-core==2.3.2
39+
graphql-relay==2.0.1
40+
h11==0.11.0
41+
Jinja2==2.11.2
42+
MarkupSafe==1.1.1
43+
motor==2.3.0
44+
multipart==0.2.2
45+
odmantic==0.3.0
46+
promise==2.3
47+
pydantic==1.7.2
48+
pymongo==3.11.0
49+
Rx==1.6.1
50+
six==1.15.0
51+
starlette==0.13.6
52+
uvicorn==0.12.2

templates/index.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
{% block main %}
44
<div class="card">
5-
<h1>Main Card 1</h1>
6-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus alias placeat impedit corporis
7-
dolores nam id necessitatibus nesciunt minima ex! Rerum inventore delectus nesciunt voluptate
8-
similique modi? Mollitia, et explicabo!.</p>
9-
<p>
10-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam perspiciatis labore autem, fugit enim
11-
voluptatibus sequi. Numquam illo sunt dolore. Magni minus, iure reprehenderit laborum dolore
12-
necessitatibus eos quae architecto!
13-
</p>
5+
<h1>Hugs</h1>
6+
7+
<h1><a href="/docs/">See the Hugs docs</a></h1>
8+
<h1><a href="/redoc/">Alternative Hugs Docs here</a></h1>
9+
10+
1411
</div>
1512
<div class="card">
1613
<h1>Main Card 2</h1>

templates/layout.html

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,7 @@ <h1>Moon Hugs</h1>
4242
<header class="major">
4343
<h3>About</h3>
4444
</header>
45-
<section style="grid-column: 1;">
46-
<p>Operation Enduring Honor Inc. is a 501(c)(3) located in South Carolina. Our goal is to make it
47-
possible for everyone to enjoy the outdoors.
48-
We want all families to enjoy picnics, hiking and camping, especially those who
49-
have physical challenges. We want to honor our Veterans for their dedication
50-
and service to our Great Country and State.</p>
5145

52-
</section>
53-
<section style="grid-column: 2;">
54-
55-
</section>
56-
<section style="grid-column: 3;">
57-
<header>
58-
<h3>Contact</h3>
59-
</header>
60-
<ul class="labeled-icons">
61-
<li>
62-
<h4 class="icon solid fa-envelope"><span class="label">Email</span></h4>
63-
<a href="#">info@operationenduringhonor.org</a>
64-
</li>
65-
<li>
66-
<h4 class="icon solid fa-phone"><span class="label">Phone</span></h4>
67-
+1(864)923-1665
68-
</li>
69-
<li>
70-
<h4 class="icon solid fa-home"><span class="label">Address</span></h4>
71-
302 Jacobs Hwy, Suite A<br>Clinton, SC 29325
72-
</li>
73-
</ul>
74-
</section>
75-
76-
<div class="copyright">
77-
&copy; Operation Enduring Honor 2020. All rights reserved.
78-
</div>
7946
</div>
8047
</div>
8148
</div>

0 commit comments

Comments
 (0)