Skip to content

Commit

Permalink
Initial folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
caulagi committed Nov 10, 2012
1 parent 9537fb2 commit 6b50400
Show file tree
Hide file tree
Showing 9 changed files with 448 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.*.swp
.monitor
node_modules/
17 changes: 16 additions & 1 deletion package.json
Expand Up @@ -11,9 +11,24 @@
"url": "git@github.com:nko3/github-messenging.git"
},
"dependencies": {
"socket.io": "0.9.11",
"express": "3.0.2",
"connect": "2.6.2",
"mocha": "1.7.0",
"jade": "0.27.7",
"passport": "0.1.3",
"passport-github": "0.1.3",
"stylus": "0.30.1",
"cradle": "0.6.2"
},
"engines": {
"node": "0.8.x"
},
"subdomain": "github-messenging.nko3"
"subdomain": "github-messenging.nko3",
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/nko3/github-messenging/master/LICENSE"
}
]
}
54 changes: 48 additions & 6 deletions server.js
@@ -1,7 +1,49 @@
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8000);
var express = require('express')
, stylus = require('stylus')
, passport = require('passport')
, util = require('util')
, GitHubStrategy = require('passport-github').Strategy;

console.log('Server running at http://0.0.0.0:8000/');
function compile(str, path) {
return stylus(str)
.set('filename', path)
.set('warn', true)
.set('compress', true);
}

var app = module.exports = express();
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({ secret: 'htuayreve'}));
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);

app.use(stylus.middleware({
src: __dirname + '/views' // .styl files are located in `views/stylesheets`
, dest: __dirname + '/static' // .styl resources are compiled `/stylesheets/*.css`
, compile: compile
}));
app.use(express.static(__dirname + '/static'));
});

app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

app.configure('production', function(){
app.use(express.errorHandler());
});

app.get('/', function(req, res, next) {
res.render('index', {
title: 'Welcome to github-messenging'
});
});

app.listen(3000)
console.info("Started on port 3000");
9 changes: 9 additions & 0 deletions static/css/bootstrap-responsive.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions static/css/bootstrap.min.css

Large diffs are not rendered by default.

0 comments on commit 6b50400

Please sign in to comment.