Skip to content

Commit

Permalink
Added hike route and new view
Browse files Browse the repository at this point in the history
  • Loading branch information
evandbrown committed Jul 11, 2013
1 parent 548ffd4 commit d036794
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
, path = require('path')
, hike = require('./routes/hike');

var app = express();

Expand All @@ -20,7 +21,7 @@ app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
// app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
Expand All @@ -29,6 +30,8 @@ if ('development' == app.get('env')) {

app.get('/', routes.index);
app.get('/users', user.list);
app.get('/hikes', hike.index);
app.post('/add_hike', hike.add_hike);

http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
Expand Down
6 changes: 6 additions & 0 deletions routes/hike.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
exports.index = function(req, res) {
res.render('hike', {title: 'My Hiking Log'});
};

exports.add_hike = function(req, res) {
};
5 changes: 5 additions & 0 deletions views/hike.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends layout

block content
h1= title
p Welcome to #{title}

0 comments on commit d036794

Please sign in to comment.