forked from sdepold/node-imageable-server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sascha Depold
committed
May 25, 2011
1 parent
becc09d
commit 51c46e6
Showing
8 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tmp | ||
tmp/* | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
body { | ||
padding: 50px; | ||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
a { | ||
color: #00B7FF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
h1= title | ||
p Welcome to #{title} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
!!! | ||
html | ||
head | ||
title= title | ||
link(rel='stylesheet', href='/stylesheets/style.css') | ||
body!= body |