Permalink
Browse files

express 3.x

  • Loading branch information...
1 parent e6173b0 commit 94e9aba08ecdec1b69cabb1b06f43e3729c3146e @arlolra committed Apr 28, 2012
Showing with 34 additions and 28 deletions.
  1. +2 −0 Makefile
  2. +3 −2 lib/routes.js
  3. +17 −15 package.json
  4. +9 −9 server.js
  5. +3 −2 {public → views}/index.html
View
@@ -0,0 +1,2 @@
+dev:
+ node_modules/.bin/node-dev server.js
View
@@ -1,8 +1,9 @@
module.exports = function (app) {
app.get('/', function (req, res, next) {
- req.send('hi')
- return next()
+ res.render('index', {
+ title: 'thoughtherder'
+ })
})
}
View
@@ -1,20 +1,22 @@
{
- "author" : "Arlo Breault <arlolra@gmail.com>"
- , "name" : "herder"
- , "version" : "0.0.1"
- , "homepage" : "http://thoughtherder.com"
- , "repository" : {
- "type" : "git"
- , "url" : "git@github.com:arlolra/herder.git"
+ "author": "Arlo Breault <arlo@thoughtherder.org>"
+ , "name": "herder"
+ , "version": "0.0.1"
+ , "homepage": "http://thoughtherder.org"
+ , "repository": {
+ "type": "git"
+ , "url": "git@github.com:arlolra/herder.git"
}
- , "main" : "server.js"
- , "engines" : {
- "node" : "0.6.x"
+ , "main": "server.js"
+ , "engines": {
+ "node": "0.6.x"
}
- , "dependencies" : {
- "async" : "0.1.x"
- , "redis" : "0.7.x"
- , "restify" : "1.0.x"
- , "underscore" : "1.3.x"
+ , "dependencies": {
+ "consolidate": "0.3.0"
+ , "express": "3.0.0alpha2"
+ , "hogan.js": "2.0.0"
+ }
+ , "devDependencies": {
+ "node-dev": "0.2.2"
}
}
View
@@ -1,20 +1,20 @@
#!/usr/bin/env node
-var restify = require('restify')
- , redis = require('redis')
+var express = require('express')
+ , cons = require('consolidate')
, routes = require('./lib/routes')
, pack = require('./package.json')
+ , app = express()
, port = 1337
-// setup
-var app = restify.createServer({
- name : pack.name
- , version : pack.version
-})
-app.use(restify.queryParser())
+// setup
+app.engine('html', cons.hogan)
+app.set('view engine', 'html')
+app.set('views', __dirname + '/views')
+app.use(express.static(__dirname + '/public'))
-// attach the routes
+// attach various things
routes(app)
// listen
@@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>thoughtherder</title>
+ <title>{{ title }}</title>
<link href="//fonts.googleapis.com/css?family=Old+Standard+TT"
type="text/css" rel="stylesheet" />
@@ -53,7 +53,8 @@
<p>Licensed under a
<a rel="license"
href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
- Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.</p>
+ Creative Commons Attribution-NonCommercial-ShareAlike 3.0
+ Unported License</a>.</p>
</div>
<div class="span1"></div>

0 comments on commit 94e9aba

Please sign in to comment.