Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmuellr/cf-node-hello
https://github.com/pmuellr/cf-node-hello
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmuellr/cf-node-hello
- Owner: pmuellr
- Created: 2013-12-11T19:56:30.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-04T18:00:38.000Z (about 10 years ago)
- Last Synced: 2024-04-09T21:04:43.998Z (10 months ago)
- Language: JavaScript
- Size: 172 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cf-node-hello
================================================================================A "Hello World" node sample for Cloud Foundry.
install
--------------------------------------------------------------------------------After cloning this project onto your local machine, and `cd`'ing into the
directory, install the dependencies using `npm`, as so:$ git clone https://github.com/pmuellr/cf-node-hello.git
... git output here ...
$ cd cf-node-hello
$ npm install
... npm output here ...
run locally
--------------------------------------------------------------------------------After installing, run the server using
node server
This should print the following to the console.
server starting on http://localhost:port/
To use a different port, set the PORT environment variable
PORT=3001 node server
Once the server is running, test it by visiting
http://localhost:port/some/url
You should see the same content for every URL, which will be
Hello World
pushing to a Cloud Foundry site
--------------------------------------------------------------------------------For more information on the basics of pushing apps, see the Cloud Foundry docs
available at
[Cloud Foundry Developer Guide](http://docs.cloudfoundry.org/devguide/).You'll also need the `cf` command line tool installed; see
[cf Command Line Interface (CLI)](http://docs.cloudfoundry.org/devguide/installcf/)
for more information.You will need to make one change to the source files before pushing the
application to Cloud Foundry. In the `manifest.yml` file, you will need to
change the `host` property to a unique hostname on the default domain the
app will be deployed to. I always add my initials `pjm` to the end of the
app name.After logging into your Cloud Foundry provider with `cf target` and `cf login`,
you can push the app to a Cloud Foundry site usingcf push
files
--------------------------------------------------------------------------------`server.js`
The server written with node.js. This server was adapted from the
*[example provided in the node docs](http://nodejs.org/api/synopsis.html)*.The server uses the [cfenv package](https://www.npmjs.org/package/cfenv)
to access the environmental information for your app when running on Cloud Foundry.---
`.cfignore`
List of file patterns that should **NOT** be uploaded to your Cloud Foundry site.
---
`.gitignore`
List of file patterns that should **NOT** be stored in git.
---
`package.json`
Standard package.json file for node packages.
---
`manifest.yml`
The Cloud Foundry manifest that describes properties associated with the
deployment of this app. For more information on manifests, see
[Deploying with Application Manifests](http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html).---
`Procfile`
Provides compatibility with Heroku or other PaaS's that use a `Procfile`.
---
`README.md`
This file!