Permalink
Browse files

Adding node.js dummy app

  • Loading branch information...
1 parent 475d7ad commit 57a14ddd4f99ae669062d4700d435e8d35480c50 James Broad committed Jun 6, 2012
Showing with 72 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +36 −0 app/app.js
  3. +10 −0 app/package.json
  4. +8 −0 app/public/stylesheets/style.css
  5. +8 −0 app/routes/index.js
  6. +2 −0 app/views/index.jade
  7. +6 −0 app/views/layout.jade
  8. +1 −1 features/support/env.rb
View
@@ -0,0 +1 @@
+node_modules
View
@@ -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('/card/create', routes.index);
+
+app.listen(3000, function(){
+ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
+});
View
@@ -0,0 +1,10 @@
+{
+ "name": "MeBank"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "supervisor": "*"
+ , "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;
+}
View
@@ -0,0 +1,8 @@
+
+/*
+ * GET home page.
+ */
+
+exports.index = function(req, res){
+ res.render('index', { title: 'Add a card' })
+};
@@ -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
@@ -4,7 +4,7 @@
# require 'debugger'
Capybara.run_server = false
-Capybara.app_host = 'http://localhost:9000'
+Capybara.app_host = 'http://localhost:3000'
Capybara.default_selector = :css
Capybara.default_driver = :mechanize

0 comments on commit 57a14dd

Please sign in to comment.