Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

azure-nodejs-demo

Containerized Node.js Demo App for Azure App Service.

Status Pipeline Website URL CDN Endpoint
Build Status dev.yaml azure-nodejs-demo-dev.azurewebsites.net nodejsdemo-dev.azureedge.net
Build Status production.yaml azure-nodejs-demo.azurewebsites.net nodejsdemo-prod.azureedge.net

Architecture

This demo leverages the Static Content Pattern in Cloud Architecture.

The images and CSS can be served from app itself or pulled from external host, e.g. CDN via ASSETS_BASE_URL environment variable.

Demo Architecture

Real-World CI/CD Pipelines

In real life you have more than one environment.

  • Azure Pipelines Best Practices

    • CI pipeline for feature branches and main
    • Deploy when pushing to main or production branches
    • See ./azure-pipelines for working pipelines and details
  • Asset Pipeline
    The included cd.yaml pipeline shows how to upload assets to Blob Storage and purge the Azure CDN cache as part of your deployment process.

  • CI/CD & Versioning
    Example versioning and promotion strategies leveraging git commit messages, git tags and package.json.

Azure Demo

Endpoints

Method Path Description
GET / root
GET /health health check endpoint
POST /webhooks/test accepts JSON and logs output

Healthcheck

This is an example healthcheck endpoint with standardized JSON per draft IETF standard

{
  "status": "pass",
  "version": "0.7.1",
  "details": {
    "uptime": {
      "component_type": "system",
      "observed_value": 24208698,
      "human_readable": "0 days, 6 hours, 43 minutes, 28 seconds",
      "observed_unit": "ms",
      "status": "pass",
      "time": "2021-04-12T11:45:32.508Z"
    },
    "env": {
      "WEBSITE_HOSTNAME": "azure-nodejs-demo-dev.azurewebsites.net",
      "WEBSITE_INSTANCE_ID": "03e7481d3d5ff1e67e297f158abd943ce8c8b920fa55dc7bf0565e86886404a8",
      "ASSETS_BASE_URL": "https://nodejsdemo-dev.azureedge.net"
    }
  }
}