Skip to content

A sample Express application to deploy to Cloud Foundry which works out of the box.

License

Notifications You must be signed in to change notification settings

bluebosh/cf-sample-app-nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CF Sample App Node.js

A sample Express application to deploy to Cloud Foundry which works out of the box.

Run locally

  1. Install Node.js and npm
  2. Run npm install
  3. Run npm start
  4. Visit http://localhost:3000

Run in the cloud

  1. Install the cf CLI
  2. Run cf push my-nodejs-app -m 128M --random-route
  3. Visit the given URL

Tune app using environment variables

This application reads environment variables, which are rendered in the HTML view:

  • TITLE: page title
  • MESSAGE: page body

If you are running locally, set these variables before launching the app:

$ TITLE="New title" MESSAGE="I am updating environment variables" npm start

If you deployed the app to Cloud Foundry, use these commands to set environment variables:

$ cf set-env my-nodejs-app TITLE "New title"
$ cf set-env my-nodejs-app MESSAGE "I am updating environment variables"
$ cf restage my-nodejs-app

About

A sample Express application to deploy to Cloud Foundry which works out of the box.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.3%
  • HTML 6.8%
  • CSS 2.9%