Setting Up your Angular Development Environment

Once logged into Agility CMS, you'll want to grab your API credentials so your Angular site can authenticate and retrieve data from your instance.

From your Agility CMS dashboard, click into Settings > API Keys.

Screen_Shot_2020-11-02_at_2.21.59_PM.png

Take note of your GUID and your Live API Key and Preview API Key credentials and copy these somewhere temporarily as you'll need to use them later.

Get The Code

  1. Clone this repository, and open it in your favorite Text Editor
  2. Run npm install or yarn install to install packages and dependencies

Set up Authentication

  1. Open up your src/environments folder
  2. Overwrite the values in the environment.ts file using your PREVIEW API KEY.
  3. Overwrite the values in the environment.prod.ts file using your FETCH API KEY.
# Your Instance Id
AGILITY_GUID=
# Your Live API Key
AGILITY_API_FETCH_KEY=
# Your Preview API Key
AGILITY_API_PREVIEW_KEY=

Start The Site

To run the site locally, run npm run start or yarn start for a dev server, then Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

This will also load the latest (staging mode) content from Agility CMS. When you change the content in the CMS, simply reload your page to see those changes updated on the site.

Screen_Shot_2021-06-21_at_10.53.18_AM.png

Did you get a Build Error?

If you get an error during the build, check your log and ensure that you've entered the correct GUID and API Keys in your environment.ts and environment.prod.ts files.

1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.