diff --git a/app.js b/app.js new file mode 100644 index 0000000..b1a2fc8 --- /dev/null +++ b/app.js @@ -0,0 +1,29 @@ +/*eslint-env node*/ + +//------------------------------------------------------------------------------ +// hello world app is based on node.js starter application for Bluemix +//------------------------------------------------------------------------------ + +// This application uses express as its web server +// for more info, see: http://expressjs.com +var express = require('express'); + +// cfenv provides access to your Cloud Foundry environment +// for more info, see: https://www.npmjs.com/package/cfenv +var cfenv = require('cfenv'); + +// create a new express server +var app = express(); + +// serve the files out of ./public as our main files +app.use(express.static(__dirname + '/public')); + +// get the app environment from Cloud Foundry +var appEnv = cfenv.getAppEnv(); + +// start server on the specified port and binding host +app.listen(appEnv.port, '0.0.0.0', function() { + + // print a message when the server starts listening + console.log("server starting on " + appEnv.url); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..7e49712 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "HelloWorldNodeApp", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "node app.js" + }, + "dependencies": { + "express": "4.13.x", + "cfenv": "1.0.x" + }, + "repository": {}, + "engines": { + "node": "4.2.x" + } +} \ No newline at end of file diff --git a/public/images/newapp-icon.png b/public/images/newapp-icon.png new file mode 100644 index 0000000..41cf02f Binary files /dev/null and b/public/images/newapp-icon.png differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..d220a70 --- /dev/null +++ b/public/index.html @@ -0,0 +1,24 @@ + + + +
+
+ ![]() |
+
+ Hello world!+ |
+