Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial setup

  • Loading branch information...
commit 48a001a4f125dd69a863d5ce200681edc77a0099 1 parent e0b87bf
@robrighter authored
Showing with 9 additions and 34 deletions.
  1. +4 −14 server.js
  2. +1 −4 views/index.ejs
  3. +4 −16 views/layout.ejs
View
18 server.js
@@ -6,6 +6,8 @@ var connect = require('connect')
, io = require('Socket.IO-node')
, port = (process.env.PORT || 8081);
+var nodecms = require('node-cms');
+
//Setup Express
var server = express.createServer();
server.configure(function(){
@@ -59,19 +61,7 @@ io.on('connection', function(client){
///////////////////////////////////////////
/////// ADD ALL YOUR ROUTES HERE /////////
-
-server.get('/', function(req,res){
- res.render('index.ejs', {
- locals : {
- header: '#Header#'
- ,footer: '#Footer#'
- ,title : 'Page Title'
- ,description: 'Page Description'
- ,author: 'Your Name'
- ,analyticssiteid: 'XXXXXXX'
- }
- });
-});
+nodecms.setupExpressJSRoutes(server);
//A Route for Creating a 500 Error (Useful to keep around)
@@ -80,7 +70,7 @@ server.get('/500', function(req, res){
});
//The 404 Route (ALWAYS Keep this as the last route)
-server.get('/*', function(req, res){
+server.get('*', function(req, res){
throw new NotFound;
});
View
5 views/index.ejs
@@ -1,4 +1 @@
-<div>
- <a id="sender">send a message</a>
- <ul id="reciever"></ul>
-</div>
+<%= article %>
View
20 views/layout.ejs
@@ -11,8 +11,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><%= title %></title>
- <meta name="description" content="<%= description %>">
- <meta name="author" content="<%= author %>">
+ <meta name="description" content="">
+ <meta name="author" content="">
<!-- Mobile Viewport Fix
j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
@@ -50,7 +50,7 @@
<div id="container">
<header>
- <%= header %>
+
</header>
<div id="main">
@@ -58,7 +58,7 @@
</div>
<footer>
- <%= footer %>
+
</footer>
</div> <!--! end of #container -->
@@ -84,18 +84,6 @@
<!-- end profiling code -->
- <!-- asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
- change the UA-XXXXX-X to be your site's ID -->
- <script>
- var _gaq = [['_setAccount', '<%= analyticssiteid %>'], ['_trackPageview']];
- (function(d, t) {
- var g = d.createElement(t),
- s = d.getElementsByTagName(t)[0];
- g.async = true;
- g.src = '//www.google-analytics.com/ga.js';
- s.parentNode.insertBefore(g, s);
- })(document, 'script');
- </script>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.