Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit bc693552928f467d6a0f1a763d04f7da727938c0 @jackfranklin committed Apr 29, 2012
Showing with 69 additions and 0 deletions.
  1. +36 −0 app.js
  2. +9 −0 package.json
  3. +8 −0 public/stylesheets/style.css
  4. +8 −0 routes/index.js
  5. +2 −0 views/index.jade
  6. +6 −0 views/layout.jade
36 app.js
@@ -0,0 +1,36 @@
+
+/**
+ * Module dependencies.
+ */
+
+var express = require('express')
+ , routes = require('./routes');
+
+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('/', routes.index);
+
+app.listen(3000, function(){
+ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
+});
@@ -0,0 +1,9 @@
+{
+ "name": "application-name"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "express": "2.5.8"
+ , "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,8 @@
+
+/*
+ * GET home page.
+ */
+
+exports.index = function(req, res){
+ res.render('index', { title: 'Express' })
+};
@@ -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 bc69355

Please sign in to comment.