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
Firebase Cloud Functions
Search
Maribel Maisano
November 14, 2020
Programming
0
46
Firebase Cloud Functions
Firebase Cloud Functions - DSC Universidad Tecnológica de Panamá
Maribel Maisano
November 14, 2020
Tweet
Share
More Decks by Maribel Maisano
See All by Maribel Maisano
Estrategias de monetización en apps móviles
maribelmai
0
25
Crea tu primera app Android
maribelmai
0
59
Implementando MVVM en una app Android
maribelmai
0
49
Firebase - Backend en la nube
maribelmai
0
24
Android KTX - Mejor código gracias a Kotlin
maribelmai
0
73
Other Decks in Programming
See All in Programming
CSC307 Lecture 09
javiergs
PRO
1
830
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
CSC307 Lecture 02
javiergs
PRO
1
780
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Fragmented Architectures
denyspoltorak
0
150
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
The Curse of the Amulet
leimatthew05
1
8.4k
How to build a perfect <img>
jonoalderson
1
4.9k
Music & Morning Musume
bryan
47
7.1k
Marketing to machines
jonoalderson
1
4.6k
4 Signs Your Business is Dying
shpigford
187
22k
Transcript
Firebase Cloud Functions DSC- Universidad Tecnológica de Panamá Maribel Maisano
• @maribelmai Android Developer WTM Ambassador • GDG & WTM Buenos Aires
Por qué Firebase
El problema • Arquitectura cliente-servidor • Diseño del servidor •
Brecha de productividad entre la idea y el producto
Cloud Functions
Características • Permite definir funciones individuales a ejecutarse en la
nube sin necesidad de un servidor • Se pueden escribir bajo entorno Node.js • Se puede indicar su ejecución definiendo distintos triggers
Primeros pasos • Instalación de Firebase-CLI curl -sL https://firebase.tools |
bash
Primeros pasos • Creación de un directorio para el proyecto
firebase init
Qué hace ese comando? • Crea la estructura de directorios
necesaria • Crea el proyecto en la Firebase Console o vincula uno existente • Inicializa un proyecto Node.js • Instala las dependencias necesarias
En el archivo index.js definiremos nuestras funciones Cloud functions
Triggers (disparadores)
Request HTTP con query params exports.buscar = functions.https.onRequest((request, res) =>
{ var query = request.query.terminoBuscado // ... return res.send("OK") }
Request HTTP con body params exports.reservarPromo = functions.https.onRequest((request, response) =>
{ var idUsuario = request.body.idUsuario var idPromo = request.body.idPromo //... return response.status(200).send("OK"); }
Cambios en Firestore y Realtime Database exports.crearPartida = functions.firestore .document('partidas/{idPartida}')
.onCreate((snap, context) => { const partida = snap.data(); // Ejecutar una acción })
Deploy
Publicar funciones • Se ejecuta el comando firebase deploy y
las funciones estarán disponibles de forma pública • Todas las dependencias requeridas serán instaladas en el servidor automáticamente • Es posible utilizar el emulador para hacer deploy localmente
None
¡Veámoslo funcionando!
En qué puedo aplicarlo?
Enlaces útiles • Cloud Functions Codelab https://codelabs.developers.google.com/codelabs/firebase-cloud-fun ctions • Empieza
a usar Cloud Functions para Firebase - Firecasts https://www.youtube.com/watch?v=DYfP-UIKxH0&list=PLl-K7zZEsYLk PZHe41m4jfAxUi0JjLgSM • Cloud Functions para Firebase https://firebase.google.com/docs/functions?hl=es
¿Preguntas? Maribel Maisano • @maribelmai Android Developer WTM Ambassador •
GDG & WTM Buenos Aires
¡Muchas gracias! Maribel Maisano • @maribelmai Android Developer WTM Ambassador
• GDG & WTM Buenos Aires