Skip to main content

Connect to App Services

It's time to connect the web application to Atlas App Services.

  1. First, open Cloud Shell Editor. The editor may look suspiciously like VSCode. This is because both projects use some of the same open-sourced components such as the Monaco Editor and the Language Server Protocol. You should see your cloned project on the left.

    Cloud Shell Editor highlighting the project directory on the left hand-side
  2. Open the environment.prod.ts file. You should see the following content.

    Google-Cloud-MongoDB-Atlas-Workshop/src/environments/environment.prod.ts
    export const environment = {
    production: true,
    APP_ID: '',
    GRAPHQL_URI: '',
    API_KEY: ''
    };
    note

    Note that you should edit the environment.prod.ts file and not the environment.ts file. The first is used by Angular when building the application for production and the second — when building for development.

  3. Add your own credentials to this file. You can either copy them from the open StackBlitz application or follow the instructions from Chapter 2 to get them from App Services.