Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 864608c6cd2bd6e034bef963c83d30af3a2ffa9a @jasonkuhrt committed Jun 13, 2011
Showing with 85 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Procfile
  3. +38 −0 app.js
  4. +8 −0 package.json
  5. +8 −0 public/stylesheets/style.css
  6. +21 −0 test/app.test.js
  7. +2 −0 views/index.jade
  8. +6 −0 views/layout.jade
@@ -0,0 +1 @@
+node_modules
@@ -0,0 +1 @@
+web: node app.js
38 app.js
@@ -0,0 +1,38 @@
+
+/**
+ * Module dependencies.
+ */
+
+var express = require('express');
+
+var app = module.exports = express.createServer();
+
+// Configuration
+
+app.configure(function(){
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'jade');
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(app.router);
+ app.use(express.static(__dirname + '/public'));
+});
+
+app.configure('development', function(){
+ app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
+});
+
+app.configure('production', function(){
+ app.use(express.errorHandler());
+});
+
+// Routes
+
+app.get('/', function(req, res){
+ res.render('index', {
+ title: 'Express'
+ });
+});
+
+app.listen(3000);
+console.log("Express server listening on port %d", app.address().port);
@@ -0,0 +1,8 @@
+{
+ "name": "vanyarose-test"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "jade": ">= 0.0.1"
+ }
+}
@@ -0,0 +1,8 @@
+body {
+ padding: 50px;
+ font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+a {
+ color: #00B7FF;
+}
@@ -0,0 +1,21 @@
+
+// Run $ expresso
+
+/**
+ * Module dependencies.
+ */
+
+var app = require('../app')
+ , assert = require('assert');
+
+
+module.exports = {
+ 'GET /': function(){
+ assert.response(app,
+ { url: '/' },
+ { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' }},
+ function(res){
+ assert.includes(res.body, '<title>Express</title>');
+ });
+ }
+};
@@ -0,0 +1,2 @@
+h1= title
+p Welcome to #{title}
@@ -0,0 +1,6 @@
+!!!
+html
+ head
+ title= title
+ link(rel='stylesheet', href='/stylesheets/style.css')
+ body!= body

0 comments on commit 864608c

Please sign in to comment.