Permalink
Browse files

Primer commit

  • Loading branch information...
0 parents commit b990425e993225ca9c46321e19a348a1ca473f53 Ricardo Lanziano committed Jan 24, 2012
Showing with 67 additions and 0 deletions.
  1. +36 −0 app.js
  2. +10 −0 package.json
  3. +5 −0 public/stylesheets/style.styl
  4. +8 −0 routes/index.js
  5. +2 −0 views/index.jade
  6. +6 −0 views/layout.jade
@@ -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(require('stylus').middleware({ src: __dirname + '/public' }));
+ 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);
+console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
@@ -0,0 +1,10 @@
+{
+ "name": "application-name"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "express": "2.5.5"
+ , "stylus": ">= 0.0.1"
+ , "jade": ">= 0.0.1"
+ }
+}
@@ -0,0 +1,5 @@
+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 b990425

Please sign in to comment.