Code Monkey home page Code Monkey logo

node-app3's Introduction

Node.js - Demo app for Azure

This is a simple Node.js web app using the Express framework and EJS templates.

Based on the standard express-generator template with EJS views e.g. express --git --view=ejs but has been enhanced with Bootstrap, FontAwesome and App Insights. The app has two basic pages accessed from the nav bar menu:

  • SYSTEM - Will show some system & runtime information, and will also display if the app is running from within a Docker container.
  • WEATHER - Performs geo IP reverse lookup of the requesting client using freegeoip.net. The resulting location is used to fetch a weather forecast from the Dark Sky weather API. The results are show using animated Skycons. The has the added bonus of allowing you to see dependency calls (out to both external APIs) on the App Insights map

screen screen

Running

Standard npm install and start with npm start. Web app will be listening on the usual Express port of 3000 or what is set in PORT environmental variable. Tested with both Node 6.11 and 8.9

Docker

Public Docker image is available on Dockerhub.
Note. The Docker image includes SSH support, this is to enable the web console feature when running this app as a container in Azure Web App for Containers.
Run with docker run -d -p 3000:3000 bencuk/nodejs-demoapp

Application Insights

The app has been instrumented with the Application Insights SDK, it will however need to be configured to point to your App Insights instance.
To configure this, set the APPINSIGHTS_INSTRUMENTATIONKEY environmental variable to the relevant key for your active instance. If running in an Azure Web App, this can be set as an application setting in Azure.

This article has more information on monitoring App Insights with Node.js

Azure Templates

Templates for deployment to Azure with "quick deploy" buttons are here

Updates

  • Feb 2018 - Updated App Insights monitoring
  • Nov 2017 - Update to use Node 8.9
  • Oct 2017 - Updated App Insights, improved Dockerfile
  • Sept 2017 - Added weather page
  • Sept 2017 - Major revamp. Switched to EJS, added Bootstrap and App Insights
  • Aug 2017 - Minor changes and fixes for CRLF stuff
  • July 2017 - Updated Dockerfile to use super tiny Alpine Node 6 image
  • June 2017 - Moved repo to Github

node-app3's People

Contributors

benc-uk avatar talalmalik89 avatar

Stargazers

Roman avatar

Watchers

Mudassar Muneer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.