nodejs app started

This commit is contained in:
2015-03-23 13:15:28 -04:00
parent e4a297a28d
commit 6e43cdf6a0
7 changed files with 87 additions and 0 deletions

4
.gitignore vendored
View File

@@ -31,3 +31,7 @@ node_modules
*.aux
*.toc
/proposal/proposal.out
#nodejs things
node_modules
npm-debug.log

33
app.js Normal file
View File

@@ -0,0 +1,33 @@
/*
* Modules
*/
var express = require('express');
var path = require('path');
var app = express();
app.configure(function() {
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.static(path.join(__dirname, 'public')));
//debug error handler
app.use(express.errorHandler());
app.locals.pretty = true;
});
/*
* Routes
* Add additional views here :-)
*/
//index
app.get('/', require('./routes/index')());
app.listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});

15
package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "c0db",
"version": "0.0.1",
"repository": {
"type": "git",
"url": "https://github.com/aarongut/cdb.git"
},
"bugs": {
"url": "https://github.com/aarongut/cdb/issues"
},
"dependencies": {
"express": "~3.4.8",
"jade": "~1.1.5"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

5
routes/index.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = function(db) {
return function (req, res) {
res.render('index');
}
}

22
views/base.jade Normal file
View File

@@ -0,0 +1,22 @@
doctype html
html
head
meta(charset="utf-8")
link(rel="stylesheet"
href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css")
block head
body
block body
script(type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js")
script(type="text/javascript"
src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js")
block script

8
views/index.jade Normal file
View File

@@ -0,0 +1,8 @@
extends base
block head
title c0db
block body
div.jumbotron c0db