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
Firebase Japan User Group - meetup #9
Search
kappa0923
January 17, 2019
Programming
820
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase Japan User Group - meetup #9
kappa0923
January 17, 2019
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
340
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
170
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
290
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
220
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
2
300
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
170
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.9k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
360
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
380
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
340
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.1k
Embracing the Ebb and Flow
colly
88
5.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
340
The Curious Case for Waylosing
cassininazir
1
540
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
Cloud FunctionsでURL短縮 サービスを作ろう! Firebase Meetup #9 Cloud Functions Day @Google
kappa0923
Agenda ▸ 自己紹介 ▸ Cloud Functionsで何を作るか? ▸ どうやって作るのか ▸ ついでにCIも考える
▸ まとめ 2
Self Introduction ▸ 渡辺 友康 ▹ kappa0923 ▸ 株式会社アイソルート クラウドソリューショングループ所属
▹ クラウド周りのアーキテクトやってます ▸ SNS ▹ GitHub : kappa0923 ▹ Twitter : @tom_kappa0923 ▸ Other ▹ GDG Tokyo オーガナイザー 3
今日のターゲット 4 経験者 初学者 この辺
Cloud Functionsで 何を作るか?
何を作るか? URL短縮サービスを作ります! ↓ https://nabe.ga/ 6
何を作るか? なんで? 7
何を作るか? GitHubにCloudFunctionsを利用した URL短縮のサンプルがあった https://github.com/firebase/functions-samples/t ree/Node-8/url-shortener けどBit.lyのAPIを使ってる。。。 8
何を作るか? これなら自分で作っても良いのでは
どうやって作るか
どうやって作るか 11 ▸ Cloud FunctionsでCloud Firestoreから リダイレクト先のURLを読み込み、 301リダイレクトのレスポンスをすればOK
どうやって作るか 12 ▸ リダイレクトの処理はFunctionsの 関数を呼び出すように、firebase.jsonに rewrite設定をしておく ▸ これで独自ドメインで関数が呼び出せる
どうやって作るか 13 ▸ Firestoreからの読み込みにはFunctionsで Firebase Admin SDKを使うので FirestoreのルールはロックモードでOK!
どうやって作るか 14 ▸ でもFunctionsの実行回数が心配。。。 ▸ なら、キャッシュさせてしまおう! cf. https://firebase.google.com/docs/hosting/functions?hl=ja#manage_cach e_behavior
ついでにCIも考える
ついでにCIも考える 16 ▸ せっかくなのでCIも実現しよう! cf. https://www.isoroot.jp/blog/1349/ ▸ GOOGLE_APPLICATION_CREDENTIALSを 使ってサービスアカウントでデプロイする cf.
https://github.com/firebase/firebase-tools/releases/tag/v6.1.0 ▸ 注意 : Firebase Hosting APIを有効にしておく必要あり
ついでにCIも考える 17 ▸ CircleCIだとこんな感じ
ついでにCIも考える 18 ▸ Hostingのデプロイは成功するのに Functionsのデプロイに失敗する。。。 ▸ どうやらバグらしい https://github.com/firebase/firebase-tools/issues/787 ▸
まとめ
まとめ 20 ▸ Cloud FunctionsとHostingのちょっと 変わった使い方を紹介しました ▸ 節約のためにCacheは上手く使いましょう ▸ Firebaseは小さいプロダクトを素早く試すのに◎
いろいろ作ってみよう!
お疲れ様でした 何か質問があれば