Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ZappaでDBもパッケージしたサーバーレスAPIを構築してみた
Search
Yasunori Kirimoto
May 11, 2019
Technology
0
480
ZappaでDBもパッケージしたサーバーレスAPIを構築してみた
PyCon mini Sapporo 2019 発表資料
Yasunori Kirimoto
May 11, 2019
Tweet
Share
More Decks by Yasunori Kirimoto
See All by Yasunori Kirimoto
強化されたAmazon Location Serviceによる新機能と開発者体験
dayjournal
3
230
FOSS4Gで実現するQGIS版Amazon Location Service Plugin
dayjournal
0
890
State of Open Source Web Mapping Libraries
dayjournal
0
530
AWS Heroes Map 秘伝のレシピ
dayjournal
2
270
State of Amazon Location Service
dayjournal
0
340
State of Amazon Location Service
dayjournal
1
610
MapLibreとAmazon Location Service
dayjournal
1
700
AWS re:Invent 2023 現地での体験
dayjournal
1
1k
英語が苦手でも世界にアウトプットしている話
dayjournal
3
1.8k
Other Decks in Technology
See All in Technology
怖くない!はじめてのClaude Code
shinya337
0
250
本が全く読めなかった過去の自分へ
genshun9
0
660
KubeCon + CloudNativeCon Japan 2025 Recap
ren510dev
1
280
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
4
3.1k
rubygem開発で鍛える設計力
joker1007
2
260
ネットワーク保護はどう変わるのか?re:Inforce 2025最新アップデート解説
tokushun
0
140
Tokyo_reInforce_2025_recap_iam_access_analyzer
hiashisan
0
130
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
280
Yamla: Rustでつくるリアルタイム性を追求した機械学習基盤 / Yamla: A Rust-Based Machine Learning Platform Pursuing Real-Time Capabilities
lycorptech_jp
PRO
4
160
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
930
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
210
標準技術と独自システムで作る「つらくない」SaaS アカウント管理 / Effortless SaaS Account Management with Standard Technologies & Custom Systems
yuyatakeyama
3
1.3k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
140
7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
How to train your dragon (web standard)
notwaldorf
94
6.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Side Projects
sachag
455
42k
Into the Great Unknown - MozCon
thekraken
39
1.9k
The Language of Interfaces
destraynor
158
25k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Transcript
ZappaでDBもパッケージした サーバーレスAPIを構築してみた Yasunori Kirimoto 2019.05.11 PyCon mini Sapporo 2019
GIS engineer, Web engineer dayjournal : Self-employed Yasunori Kirimoto MIERUNE
Inc. : Co-founder
技術書典6で本だしました
Contents はじめに 環境構築 API開発 デプロイ 実装例
Introduction はじめに
Zappaを知っている方いますか
Zappaとは、AWSのLambdaやAPI Gateway等の サービスを利用し、Webアプリケーションを手軽に 構築できるPythonのサーバーレスフレームワーク
住所検索API
CHAPTER01 環境構築
: Pythonの仮想環境構築ツール pyenv virtualenv AWS CLI 事前準備 インストール & 設定
: Pythonのバージョン切り替えツール : AWSのコマンドラインツール
仮想環境構築
パッケージインストール
パッケージインストール
パッケージインストール
CHAPTER02 API開発
: API用のPythonファイル db.sqlite app.py API配信用ファイル一覧 : 住所検索用のSQLiteファイル
db.sqlite ・DBもパッケージしたAPIを構築するためSQLiteを利用 ・国土地理院の「住居表示住所」データを利用 ※ 電子国土基本図(地名情報)「住居表示住所」データを利用するためには、 国土地理院へ利用申請が必要です。
app.py
app.py
ローカル環境確認
ローカル環境確認
CHAPTER03 デプロイ
デプロイ環境構築
zappa_settings.json
デプロイ
デプロイ
デプロイ
デプロイ Lambda
デプロイ API Gateway
削除 & 更新 & ログ
その他設定
CHAPTER04 実装例
を利用した位置情報の可視化 フロントエンドとの連携 Angular を利用したリスト表示
Angularを利用したリスト表示
None
Angular CLI & 環境設定 ・Angular v7.2.0 ・Angular Material v7.3.7 ・TypeScript
v3.2.2 事前準備 インストール & 設定
変更ファイル一覧
/src/app/app.module.ts
/src/environments/environment.ts /src/environments/environment.prod.ts
/src/app/service/config.service.ts
/src/app/app.component.ts
/src/app/app.component.html
build dev
を利用した位置情報の可視化
Maptiles by MIERUNE, under CC BY. Data by OpenStreetMap contributors,
under ODbL.
事前準備 インストール & 設定 mapboxgljs-starter https://github.com/dayjournal/mapboxgljs-starter Install package
変更ファイル一覧
/_resouce/js/script.js
/_resouce/js/script.js
/_resouce/js/script.js
build dev
Conclusion まとめ
・Zappaで手軽にサーバーレスが可能 ・オプション以上の設定は別の方法を検討 ・DBのパッケージも可能(容量制限250MB) ・地図の可視化にも利用可能
@dayjournal_nori ありがとうございました!