Permalink
Browse files

initial import

  • Loading branch information...
1 parent becc09d commit 51c46e67c5418ee89f32e515ddf3731a5ccd6de3 Sascha Depold committed May 25, 2011
Showing with 108 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +44 −0 app.js
  3. +24 −0 package.json
  4. +8 −0 public/stylesheets/style.css
  5. +21 −0 test/app.test.js
  6. 0 tmp/.gitkeep
  7. +2 −0 views/index.jade
  8. +6 −0 views/layout.jade
View
@@ -0,0 +1,3 @@
+tmp
+tmp/*
+node_modules
View
44 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);
+}
View
@@ -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"
+ }
+}
@@ -0,0 +1,8 @@
+body {
+ padding: 50px;
+ font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+a {
+ color: #00B7FF;
+}
View
@@ -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>');
+ });
+ }
+};
View
No changes.
View
@@ -0,0 +1,2 @@
+h1= title
+p Welcome to #{title}
View
@@ -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.