Slide 1

Slide 1 text

Hosting with Firebase Ire Aderinokun Google Launchpad Build 2016 (Lagos)

Slide 2

Slide 2 text

Hello! • Ire Aderinokun • User Interface Designer & Front-End Developer • Head of Technology, Big Cabal Media • Google Developer Expert (Web Technologies)

Slide 3

Slide 3 text

What We’ll Cover • What is Firebase Hosting? • Why Static Hosting? • Key Features of Firebase Hosting • Getting Started with Firebase Hosting • More Features of Firebase Hosting

Slide 4

Slide 4 text

What is Firebase Hosting?

Slide 5

Slide 5 text

The Firebase Suite

Slide 6

Slide 6 text

The Firebase Suite

Slide 7

Slide 7 text

Firebase Hosting is production-grade, web content hosting for developers

Slide 8

Slide 8 text

“Production Grade”

Slide 9

Slide 9 text

“Web Content”

Slide 10

Slide 10 text

“For Developers”

Slide 11

Slide 11 text

Why Static Hosting?

Slide 12

Slide 12 text

Increase in Popularity Decrease in Popularity Stack Overflow Developer Survey 2016 (http://stackoverflow.com/research/developer-survey-2016)

Slide 13

Slide 13 text

The Power of Front-End Frameworks

Slide 14

Slide 14 text

Progressive Web Applications

Slide 15

Slide 15 text

Key Features of Firebase Hosting

Slide 16

Slide 16 text

Served Over a Secure Connection

Slide 17

Slide 17 text

Zero-configuration SSL is built into Firebase Hosting so content is always delivered securely

Slide 18

Slide 18 text

The Importance of HTTPS • Security for Users • Modern Web APIs require HTTPS (e.g. Service Worker, Push API) • The Future Default

Slide 19

Slide 19 text

Fast Content Delivery

Slide 20

Slide 20 text

Each file you upload is cached on SSDs at CDN edges around the world

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Rapid Deployment

Slide 23

Slide 23 text

Using the Firebase CLI, you can get your app up and running in seconds

Slide 24

Slide 24 text

firebase deploy

Slide 25

Slide 25 text

One-Click Rollbacks

Slide 26

Slide 26 text

Firebase Hosting provides full versioning and release management with one-click rollbacks

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Getting Started with Firebase Hosting

Slide 29

Slide 29 text

4 Simple Steps 1. Create a new Firebase project 2. Install the Firebase CLI 3. Initialise your application 4. Deploy your website

Slide 30

Slide 30 text

1. Create a Firebase project

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

2. Install the Firebase CLI

Slide 33

Slide 33 text

Dependencies • Node.js (> 0.10.0) • NPM

Slide 34

Slide 34 text

npm install -g firebase-tools

Slide 35

Slide 35 text

3. Initialise your Application

Slide 36

Slide 36 text

firebase init

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

firebase.json { “hosting”: { “public”: “app”, “ignore”: [ “firebase.json”, “**/*.*”, “**/node_modules/**” ] } }

Slide 39

Slide 39 text

.firebaserc { “projects”: { “default”: “PROJECT_NAME_HERE” } }

Slide 40

Slide 40 text

4. Deploy your Website

Slide 41

Slide 41 text

firebase deploy

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

https://YOUR_FIREBASE_APP_NAME.firebaseapp.com

Slide 44

Slide 44 text

More Features

Slide 45

Slide 45 text

Do More with Firebase • Hooking up a Custom Domain • Setting up a Staging Environment • Setting up URL Redirects and Rewrites • Setting Custom Headers • Scaling your Application

Slide 46

Slide 46 text

Hooking up a Custom Domain

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Automatically Secure

Slide 49

Slide 49 text

Setting up a Staging Environment

Slide 50

Slide 50 text

1. Create a new Firebase Project

Slide 51

Slide 51 text

2. Link New Project Under “staging” Alias firebase use --add

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

.firebaserc { “projects”: { “default”: “offline-fx”, “staging”: “offline-fx-staging” } }

Slide 54

Slide 54 text

3. Deploy from “staging” Environment

Slide 55

Slide 55 text

Setting up URL Redirects & Rewrites

Slide 56

Slide 56 text

Redirects { “redirects”: [{ “source”: “/old-url-path”, “destination”: “/new-url-path”, “type”: 301 }] }

Slide 57

Slide 57 text

Rewrites { “rewrites”: [{ “source”: “**”, “destination”: “/index.html” }] }

Slide 58

Slide 58 text

Setting Custom Headers

Slide 59

Slide 59 text

Headers • Cache-Control • Access-Control-Allow-Origin • X-UA-Compatible • X-Content-Type-Options • X-Frame-Options • X-XSS-Protection • Content-Type

Slide 60

Slide 60 text

e.g. Access-Control-Allow-Origin { “headers”: [{ “source”: “**/*.@(eot|otf|ttf|ttc|woff|font.css)”, “headers”: [{ “key”: “Access-Control-Allow-Origin”, “value”: “*” }] }] }

Slide 61

Slide 61 text

e.g. Cache-Control { “headers”: [{ “source”: “**/*.@(jpg|jpeg|gif|png)”, “headers”: [{ “key”: “Cache-Control”, “value”: “max-age=7200” }] }] }

Slide 62

Slide 62 text

Scaling your Application

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

Thank You! @IreAderinokun #LaunchpadDev