Skip to content

Commit

Permalink
Merge pull request #105 from LeslieLeung/feature/welcome-page
Browse files Browse the repository at this point in the history
  • Loading branch information
LeslieLeung authored Jul 24, 2024
2 parents 8105d03 + 9ddfd37 commit 3ab4f8a
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 174 deletions.
3 changes: 2 additions & 1 deletion heimdallr/api/api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from fastapi import APIRouter

from heimdallr.api import competable, push, webhook
from heimdallr.api import competable, push, webhook, welcome

router = APIRouter()
router.include_router(welcome.welcome_router)
router.include_router(webhook.webhook_router)
router.include_router(competable.competable_router)
router.include_router(push.push_router)
58 changes: 58 additions & 0 deletions heimdallr/api/welcome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from fastapi import APIRouter
from fastapi.responses import HTMLResponse

welcome_router = APIRouter()


@welcome_router.get("/", response_class=HTMLResponse)
async def welcome():
return """
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Heimdallr!</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
.welcome-message {
text-align: center;
font-size: 2em;
color: #333;
}
.small-text {
color: #666;
font-size: 0.8em;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #666; /* Changed the color here */
color: white;
text-align: center;
padding: 10px 0;
}
</style>
</head>
<body>
<div class="welcome-message">
<h1>🎉Welcome to Heimdallr!🎉</h1>
<p>部署成功!查看<a href="/docs">接口文档</a></p>
<p class="small-text">不知道怎么用?查看<a href="https://github.com/LeslieLeung/heimdallr#%E7%A4%BA%E4%BE%8B%E5%BA%94%E7%94%A8" target="_blank">示例应用</a></p>
</div>
<footer>
<p>如果觉得本项目不错,不妨给个Star!<a href="https://github.com/leslieleung/heimdallr" target="_blank">GitHub</a></p>
</footer>
</body>
</html>
"""
Loading

0 comments on commit 3ab4f8a

Please sign in to comment.