Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding node.js dummy app

  • Loading branch information...
commit 57a14ddd4f99ae669062d4700d435e8d35480c50 1 parent 475d7ad
James Broad authored
View
1  .gitignore
@@ -0,0 +1 @@
+node_modules
View
36 app/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('/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
10 app/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "MeBank"
+ , "version": "0.0.1"
+ , "private": true
+ , "dependencies": {
+ "supervisor": "*"
+ , "express": "2.5.8"
+ , "jade": ">= 0.0.1"
+ }
+}
View
8 app/public/stylesheets/style.css
@@ -0,0 +1,8 @@
+body {
+ padding: 50px;
+ font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+a {
+ color: #00B7FF;
+}
View
8 app/routes/index.js
@@ -0,0 +1,8 @@
+
+/*
+ * GET home page.
+ */
+
+exports.index = function(req, res){
+ res.render('index', { title: 'Add a card' })
+};
View
2  app/views/index.jade
@@ -0,0 +1,2 @@
+h1= title
+p Welcome to #{title}
View
6 app/views/layout.jade
@@ -0,0 +1,6 @@
+!!!
+html
+ head
+ title= title
+ link(rel='stylesheet', href='/stylesheets/style.css')
+ body!= body
View
2  features/support/env.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.