Fireship · @fireship
Angular 4 Development and Production Environments with Firebase
Uploaded April 7, 2017 · Length 1:50
Summary
create separate dev and prod environments with angular and firebase
- angular firebase
- angular development environment
- angular production environment
- firebase configuration
- angular firebase setup
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
welcome to angular firebase today I'm
- 0:02
going to show you how to create separate
- 0:04
back-end environments for development
- 0:06
and production with angular for
- 0:08
maintaining separate environments allows
- 0:10
you to build and test new features
- 0:12
without screwing up data from your live
- 0:14
production app step one create two fire
- 0:17
based projects before jumping into the
- 0:19
code you'll need two separate projects
- 0:21
on fire firebase one for development and
- 0:23
one for production step 2 create the
- 0:26
environment files in this case I have
- 0:29
cloned the fire starter app from github
- 0:30
and the first step is to create the
- 0:33
environment file files manually if you
- 0:35
create a new app with the angular CLI
- 0:37
then these files are going to be here by
- 0:40
default and then also make sure to add
- 0:42
these files to your git ignore because
- 0:44
they hold sensitive credentials and you
- 0:46
don't want that ending up in a public
- 0:48
repo step 3
- 0:51
paste in the firebase configuration into
- 0:54
each of the environment files step 4
- 1:00
bootstrap the environment in the app
- 1:02
module now we can import the environment
- 1:05
variables anywhere in our app in this
- 1:07
case we want to bootstrap the firebase
- 1:09
configuration directly in the app module
- 1:12
the code you're looking at right now is
- 1:14
what is specifically needed to wire up
- 1:16
angular firebase with these separate
- 1:18
environments in your app module
- 1:22
step 5 serve or compile the app with
- 1:26
that done it's possible to serve the app
- 1:27
locally using either environment all we
- 1:30
have to do is add the prod to ng serve
- 1:33
and that'll serve the app in production
- 1:36
thanks for watching I'll see you on the
- 1:38
other side
- 1:42
[Music]
- 1:45
you


