Skip to content

A Node.js implementation of the Acme Air Sample Application. With datastore support of MongoDB. With runtime support of Bluemix/CloudFoundry, Docker... With Micro-Services.

License

Notifications You must be signed in to change notification settings

blueperf/acmeair-monolithic-nodejs

 
 

Repository files navigation

Acme Air in NodeJS

An implementation of the Acme Air sample application for NodeJS. This implementation is a monolithic mode & supports Mongo DB (both standalone & Compose Mongo DB). The application can be deployed both on-prem as well as on Cloud platforms.

Setup

Setup DB

  • First, create a Compost account, then create a Mongo DB Deployment (It is a paid service with 30 days free trial)
  • Create a database with the name "acmeair"
  • get these information:
    • "hostname
    • "port"
    • "db"
    • "username"
    • "password"

For CF

  • ibmcloud cf push acme-node-myname -m 512M

Add these environment variables and restage

  • MONGO_MANUAL : true
  • MONGO_HOST :
  • MONGO_PORT :
  • MONGO_DBNAME :
  • MONGO_USER :
  • MONGO_PASSWORD :

(Alternative) Create user provided DB Service

  • Create a string using Compose database information:

    • "url": "mongodb://username:password@hostname:port/db"
    • e.g. mongodb://acmeuser:[email protected]:27017/acmeair
  • Use CF command to create DB:

    • cf cups mongodbCompose -p "url"
    • At the URL prompt, enter above URL that was created:
    • url>mongodb://acmeuser:[email protected]:27017/acmeair
  • On IBM Cloud Dasboard, bind the created mongodbCompose service to Acmeair

    • restage/restart Acmeair application

For Kubernetes Services

  • docker build -f ./Dockerfile_KS -t registry.REGION.bluemix.net/NAMESPACE/IMAGENAME .
  • docker push registry.REGION.bluemix.net/NAMESPACE/IMAGENAME
  • Modify acmeair-monolithic-nodejs.yaml to add registry.REGION.bluemix.net/NAMESPACE/IMAGENAME as the image name
  • Modify acmeair-monolithic-nodejs.yaml to add DB connection information (Note: If there is no user setup for this DB, REMOVE MONGO_USER & MONGO_PASSWORD entries)
  • kubectl create -f ./acmeair-monolithic-node.s.yaml

Database loading

  • Go to the home page http://hostname:port
  • At the bottom of the page, click the link : Configure the Acme Air Environment > Click Load the database

Driving the load

  • Follow the instruction here

About

A Node.js implementation of the Acme Air Sample Application. With datastore support of MongoDB. With runtime support of Bluemix/CloudFoundry, Docker... With Micro-Services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 50.5%
  • JavaScript 43.6%
  • CSS 3.9%
  • Shell 1.2%
  • Dockerfile 0.8%