Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
FastAPI+VercelでZennのバッジをお手軽に作る
Search
ganyariya
January 20, 2021
Technology
920
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
FastAPI+VercelでZennのバッジをお手軽に作る
https://rakus.connpass.com/event/198587/
ganyariya
January 20, 2021
More Decks by ganyariya
See All by ganyariya
The Hundred Machine Learning 7.4-7.7
ganariya
0
76
ありがとう競技プログラミングこんにちはDocker
ganariya
0
1.7k
輪講 The hundred ML3.3-3.5
ganariya
0
120
Other Decks in Technology
See All in Technology
時うどん〜Socket.getifaddrsで学ぶネットワーク編 / Tokiudon: The Socket.getifaddrs Edition
coe401_
4
220
データ_AIの事業の勝敗をわけるもの
nek0128
1
470
AI coding 整合正規方法
philipz
0
490
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
0
480
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
140
AI時代、データエンジニアが一番おもろい
genshun9
0
680
AIは推し活である。
kurazuuuuuu
1
940
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.8k
人間はどの意思決定を手放せるのか
kawasima
15
8k
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
3
1.2k
AIエージェントを最高のパートナーに育てる方法|評価と判断軸を育てる5つのステップ
koichiaoki
1
160
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
1
3.2k
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
From π to Pie charts
rasagy
1
380
We Are The Robots
honzajavorek
0
380
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Why Our Code Smells
bkeepers
PRO
340
58k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
510
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
WCS-LA-2024
lcolladotor
0
830
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
260
Transcript
FastAPI+VercelでZennのバッジをお⼿軽に作る ganariya FastAPI+Vercel -> Zenn-Badge ganariya
ganariyaの⾃⼰紹介 普段は競技プログラミングをしています そのためバックエンドやAPIは初⼼者です 温かい⽬で⾒守ってやってください 履歴書はGitHubのGanariyaリポジトリにあります ⻑期インターンが終わり、アルバイトを探しています (もしよければぜひ...)(ぜひ...) FastAPI+Vercel -> Zenn-Badge
ganariya
デモ FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI+Vercel -> Zenn-Badge ganariya
FastAPIのご紹介 FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI is 何 Python製REST Framework 似たものだと Flask 2018年にできており⾮常にモダンで⾼機能 (Python3.6〜) ASGI
⾮同期処理 GraphQL / WebSocket FastAPIのうれしさ3選について紹介 FastAPI+Vercel -> Zenn-Badge ganariya
その1 型ヒントとバリデーション Type Hintsを積極的に利⽤したフレームワーク username:str と引数で指定すると ⾃動で引数の型をバリデーション 型が正しいかなどの確認ロジックをコードで書かなくてよい 返り値なども型の指定が可能 型
-> IDEの恩恵を受けられる @app.get("/{username}/liked", response_class=HTMLResponse) def get_liked(username: str): user: User = scrape_user(username) badge = make_badge(username, 'Zenn liked', str(user.total_liked_count)) return HTMLResponse(content=badge, status_code=200, media_type='image/svg+xml') FastAPI+Vercel -> Zenn-Badge ganariya
その2 OpenAPIとSwagger-UI FastAPIは⾃動でOpenAPIのフォーマットを吐き出す /docs にアクセスするとSwagger-UIが⾃動で作成される 型をPythonで書くとそのままSwaggerへ! FastAPI+Vercel -> Zenn-Badge ganariya
その3 ドキュメント ドキュメントがとても丁寧 TutorialからAdvancedまで体系的に書かれている ファイル分割 , モジュールのプラクティス なども触れられている FastAPI+Vercel ->
Zenn-Badge ganariya
Vercel FastAPI+Vercel -> Zenn-Badge ganariya
Vercel もともとNow(Zeit社)というサービス そのため、ネットの記事の情報がかなり混在している 似たサービスだと Heroku GitHubから⾃動デプロイ 無料枠が⼤きい 無制限のWebサイト+API Go, Python,
Node.jsなどのサーバーレス ただしデプロイ回数は1⽇あたり制限あり DBが使えない (サーバーレスなので) FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI+Vercel -> Zenn-Badge ganariya
設定ファイル {now, vercel}.json リポジトリのルートに置いてプッシュすると、Vercelが⾃動デプロイ { "version": 2, "builds": [ {
"src": "zenn_badge/app.py", "use": "@now/python" } ], "routes": [ { "src": "/.*", "dest": "zenn_badge/app.py" } ] } FastAPI+Vercel -> Zenn-Badge ganariya
FastAPI + Vercelまとめ FastAPI 型とともに過ごせる ⾮常に⾼機能でモダン Vercel 破格的無料枠 jsonファイルひとつで済む DBは外部を利⽤する
FastAPI + Vercel 開発が楽しい! FastAPI+Vercel -> Zenn-Badge ganariya
ご清聴ありがとうございました! GitHub: ganariya Qiita: ganariya Twitter: ganariya Zenn: ganariya AtCoder:
ganariya2525 FastAPI+Vercel -> Zenn-Badge ganariya