Closed chris-alexander closed 8 years ago
I've managed to refactor the code to use a variable for switching the datasource. I am looking at the options for using an environment variable instead or even the use of flags when we run gulp: e.g.
gulp --env=production
hopefully this won't take long to figure out. I will submit a PR when it is ready.
ok no probs. I'm writing gulp for dist now. My idea is trying to have the dev environment run on a port let s say 3000 and dist env running on other so with just
gulp
they run everything but in different location. I ll try to submit EOP today so you can refactor and improve with switcher local/firebase. Is that ok?
The /dist
folder needs to be a compiled version of the app that can be deployed as static assets to gh-pages. So it needs:
So it wouldn't run on a port. When we implement it as a full-stack app then we will need a port and to run it on a server like express, but for now all we need is the static compiled assets.
I'm not talking about a port for serving outside, but for testing.
I have created two instances of browserify one serving /dist/app
and other /dev/app
So you can check both are fine . It' s just for testing not deploying.
Oh ok fair enough. :+1:
So I want to do this in 2 stages:
gulp
= Local JSONgulp --prod
= Firebasegulp build
) it will change the variable to run from FirebaseOne downside to this setup is that if you change the variable manually it will ignore what you have put and replace it based on the scenarios above.
"One downside to this setup is that if you change the variable manually it will ignore what you have put and replace it based on the scenarios above." That s why I'm not too keen to use gulp for it and I d try to go with a external config file or something like this. I will look into it asap and let you know.
ok cool let me know what you come up with 👍
I think I should still do it for the deploy task to ensure that we are always working from Firebase before deploying. What do you think?
Absolutely go for it :+1:
Rewrite the angular files so that switching between running the app from Firebase and running the App from Local JSON is easier.