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 Cloud Functions
Search
Maribel Maisano
November 14, 2020
Programming
64
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase Cloud Functions
Firebase Cloud Functions - DSC Universidad Tecnológica de Panamá
Maribel Maisano
November 14, 2020
Transcript
21 slides
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
More Decks by Maribel Maisano
See All by Maribel Maisano
Estrategias de monetización en apps móviles
maribelmai
0
39
Crea tu primera app Android
maribelmai
0
70
Implementando MVVM en una app Android
maribelmai
0
68
Firebase - Backend en la nube
maribelmai
0
38
Android KTX - Mejor código gracias a Kotlin
maribelmai
0
88
Other Decks in Programming
See All in Programming
Promiseの向こう側へコンテキストを届ける ― proposal-async-context
seriseri
0
190
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
はじめてのKubernetesコントリビューション
nasa9084
0
330
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
320
読みやすい!と評判(?)の発表の準備にかける私のこだわり
shoheimitani
0
170
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
130
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
240
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
260
Spec-driven Development with AI
simas
PRO
0
2.3k
眠らない開発チームの作り方
biwakonbu
0
130
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
610
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
640
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Scaling GitHub
holman
464
140k
How to make the Groovebox
asonas
2
2.6k
A designer walks into a library…
pauljervisheath
211
25k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Facilitating Awesome Meetings
lara
57
7.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Utilizing Notion as your number one productivity tool
mfonobong
4
650
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k