Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swisscom/cf-sample-app-nodejs
A sample Express application to deploy to Cloud Foundry which works out of the box.
https://github.com/swisscom/cf-sample-app-nodejs
cloud-foundry express nodejs
Last synced: 2 months ago
JSON representation
A sample Express application to deploy to Cloud Foundry which works out of the box.
- Host: GitHub
- URL: https://github.com/swisscom/cf-sample-app-nodejs
- Owner: swisscom
- License: other
- Created: 2016-03-30T13:36:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T11:53:17.000Z (almost 2 years ago)
- Last Synced: 2023-08-20T08:10:37.073Z (over 1 year ago)
- Topics: cloud-foundry, express, nodejs
- Language: JavaScript
- Homepage:
- Size: 151 KB
- Stars: 5
- Watchers: 31
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CF Sample App Node.js
A sample [Express](http://expressjs.com/) application to deploy to Cloud Foundry which works out of the box.
## Run locally
1. Install [Node.js and npm](https://nodejs.org/)
1. Run `npm install`
1. Run `npm start`
1. Visit [http://localhost:3000](http://localhost:3000)## Run in the cloud
1. Install the [cf CLI](https://github.com/cloudfoundry/cli#downloads)
1. Run `cf push my-nodejs-app -m 128M --random-route`
1. 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 bodyIf you are running locally, set these variables before launching the app:
```shell
$ 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:
```shell
$ 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
```