Skip to content

Commit bd33c6e

Browse files
committed
openshift deploy example
1 parent d3aa3c7 commit bd33c6e

File tree

10 files changed

+99
-0
lines changed

10 files changed

+99
-0
lines changed

openshift/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Deploying a basic total.js app to OpenShift
2+
3+
- Create a Node.js application (>= 0.10)
4+
rhc app create <appname> nodejs-0.10
5+
- Add the newly created host to your registry by SSH-ing into it (follow instructions from command line)
6+
- Checkout the new application you just created
7+
rhc git-clone <appname>
8+
- Copy the example code here into your new app.
9+

openshift/controllers/default.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
exports.install = function(framework) {
2+
framework.route('/', view_homepage);
3+
};
4+
5+
function view_homepage() {
6+
var self = this;
7+
self.view('homepage');
8+
}

openshift/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var framework = require('total.js');
2+
var http = require('http');
3+
4+
framework.run(http, false, process.env.OPENSHIFT_NODEJS_PORT, process.env.OPENSHIFT_NODEJS_IP);

openshift/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "OpenShift-Sample-App",
3+
"version": "1.0.0",
4+
"description": "OpenShift Sample Application",
5+
"keywords": [
6+
"OpenShift",
7+
"Node.js",
8+
"total.js",
9+
"application",
10+
"openshift"
11+
],
12+
"author": {
13+
"name": "Joe Conley",
14+
"email": "josephpconley@gmail.com",
15+
"url": "http://www.josephpconley.com"
16+
},
17+
"engines": {
18+
"node": ">= 0.10.0",
19+
"npm": ">= 1.3.0"
20+
},
21+
"dependencies": {
22+
"total.js": "~1.5.3"
23+
},
24+
"scripts": {
25+
"start": "node index.js $OPENSHIFT_NODEJS_PORT $OPENSHIFT_NODEJS_IP"
26+
},
27+
"main": "index.js"
28+
}

openshift/public/css/default.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*auto*/
2+
3+
/*
4+
var color = 'color:red';
5+
var width = '940px';
6+
*/
7+
8+
body { padding:20px; margin:0; font:normal 12px Arial; color:#505050; }
9+
10+
.content { margin:0 auto; width: $width; padding: 10px; border-radius: 5px; $color; box-shadow: 0 0 20px rgba(0,0,0,0.5); animation: myAnimation 5s alternate; }
11+
12+
.list { border-bottom:1px solid #E0E0E0; padding-bottom:5px; margin-bottom:5px; }
13+
.list > div:first-child { font-size: 15px; }
14+
15+
@keyframes myAnimation
16+
{
17+
0% { background: white; }
18+
25% { background: #F0F0F0; }
19+
50% { background: #D0D0D0; }
20+
100% { background: #E0E0E0; }
21+
}

openshift/public/favicon.ico

8.18 KB
Binary file not shown.

openshift/public/js/default.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$(document).ready(function() {
2+
3+
});

openshift/public/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Allow: /

openshift/views/_layout.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
@{meta}
5+
<meta charset="utf-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=10" />
7+
<meta name="format-detection" content="telephone=no" />
8+
<meta name="viewport" content="width=1024, user-scalable=yes" />
9+
<meta name="robots" content="all,follow" />
10+
@{css('default.css')}
11+
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
12+
@{head}
13+
@{js('default.js')}
14+
@{favicon('favicon.ico')}
15+
</head>
16+
<body>
17+
18+
@{body}
19+
20+
</body>
21+
</html>

openshift/views/homepage.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{meta('Title', 'Description (optional)', 'Keywords (optional)')}
2+
3+
<div>Hello World!</div>

0 commit comments

Comments
 (0)