Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Depold committed May 25, 2011
1 parent becc09d commit 51c46e6
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
tmp
tmp/*
node_modules
44 changes: 44 additions & 0 deletions app.js
@@ -0,0 +1,44 @@
var express = require('express')
, imageable = require("/Users/sdepold/Projects/node-imageable/index")

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(imageable({
"secret" : "my-very-secret-secret",
"magicHash" : "magic",
"port" : 3000
}, {
before: function() { console.log('before') },
after: function() { console.log('after') }
}));
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, next){
res.render('index', {
title: 'Express'
})
})

// Only listen on $ node app.js
if (!module.parent) {
app.listen(3000);
console.log("Express server listening on port %d", app.address().port);
}
24 changes: 24 additions & 0 deletions package.json
@@ -0,0 +1,24 @@
{
"author": "DaWanda GmbH <mirko@dawanda.com>",
"name": "imageable",
"description": "On-demand image manipulation server in node.js",
"version": "0.0.1",
"homepage": "https://github.com/dawanda/node-imageable",
"repository": {
"type": "git",
"url": "git://github.com/dawanda/node-imageable.git"
},
"scripts": {
"test": "expresso"
},
"engines": {
"node": ">=v0.4.7"
},
"dependencies": {
"express": ">=2.3.7",
"jade": ">=0"
},
"devDependencies": {
"vows": ">=0.5.8"
}
}
8 changes: 8 additions & 0 deletions public/stylesheets/style.css
@@ -0,0 +1,8 @@
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}

a {
color: #00B7FF;
}
21 changes: 21 additions & 0 deletions test/app.test.js
@@ -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>');
});
}
};
Empty file added tmp/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions views/index.jade
@@ -0,0 +1,2 @@
h1= title
p Welcome to #{title}
6 changes: 6 additions & 0 deletions views/layout.jade
@@ -0,0 +1,6 @@
!!!
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body!= body

0 comments on commit 51c46e6

Please sign in to comment.