Skip to content

simonaco/puppies

Repository files navigation

Angular Cosmos DB

Original project by John Papa

You are viewing a fork adapted by Simona Cotin

You can watch John Papa build the app as part of his series here

You can view all videos together here

Learn more about developing Node.js apps with Azure's cloud services here

Docker

Create the Docker image and run it locally

dockerImage=angular-cosmosdb
docker build -t $dockerImage .
docker run -d -p 3000:80 $dockerImage

Requirements

  1. Install the Angular CLI

    npm install -g @angular/cli
  2. Install the Azure CLI

Getting Started

  1. Clone this repository

    git clone https://github.com/simonaco/puppies
    cd puppies
  2. Install the npm packages

    npm i
  3. Configure Cosmos DB server settings

    Rename the example-environment.js file to environment.js in the server/env/ folder and update it with your Cosmos DB settings. Replace the database name key, and port with your specific configuration.

    // server/env/environment.js
    const cosmosPort = 1234; // replace with your port
    const dbName = 'your-cosmos-db-name-goes-here';
    const key = 'your-key-goes-here';
    
    module.exports = {
      cosmosPort,
      dbName,
      key
    };

Running the app

  1. Build the Angular app

    ng build
  2. Launch the server

    node src/server/index.js
  3. Open the browser to http://localhost:3000

Problems or Suggestions

Open an issue here