Prerequisites
-
Optional: gcloud tool and app component to run and deploy GAE-based backend (hint:
gcloud components update app
).Once
gcloud
andapp
component are installed, you'll need to do a one-off configuration by executing the following command:gcloud config set project <project-id>
. Project ID can be any non-empty string if you just want to run the app locally.
Setup
git clone https://github.com/GoogleChrome/ioweb2015.git
cd ioweb2015
npm install
gulp setup
If you plan on modifying source code, be a good citizen and:
- Install EditorConfig plugin for your favourite browser. The plugin should automatically pick up the .editorconfig settings.
- Obey the pre-commit hook that's installed as part of
gulp setup
. It will check for JavaScript and code style errors before committing to themaster
branch.
Run gulp serve
to start a standalone backend, while still enjoying live-reload.
You'll need Go for that.
Normally the app is running in "dev" environment but you can change that
by providing --env
argument to the gulp task:
# run in dev mode, default:
gulp serve
# set app environment to production:
gulp serve --env prod
# or run as if we were in staging:
gulp serve --env stage
Not that this does not change the way the backend code is compiled or the front-end is built. It merely changes a variable values, which the app takes into account when rendering a page or responding to a request.
Running in stage
or prod
requires real credentials when accessing external services.
You'll need to run a one-off gulp decrypt
which will decrypt a service account private key.
You can also use GAE dev appserver by running gulp serve:gae
. This is closer to what
we're using in our webapp environment but a bit slower on startup.
You'll need gcloud
tool and app
component to do this.
To change the app environment when using GAE SDK, provide --env
argument:
# run in dev mode, default:
gulp serve:gae
# set app environment to production:
gulp serve:gae --env prod
# or run as if we were in staging:
gulp serve:gae