diff --git a/app.js b/app.js index 2b402ef..72dedff 100644 --- a/app.js +++ b/app.js @@ -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(); @@ -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')) { @@ -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')); diff --git a/routes/hike.js b/routes/hike.js new file mode 100644 index 0000000..fec29a9 --- /dev/null +++ b/routes/hike.js @@ -0,0 +1,6 @@ +exports.index = function(req, res) { + res.render('hike', {title: 'My Hiking Log'}); +}; + +exports.add_hike = function(req, res) { +}; \ No newline at end of file diff --git a/views/hike.jade b/views/hike.jade new file mode 100644 index 0000000..ef7b09f --- /dev/null +++ b/views/hike.jade @@ -0,0 +1,5 @@ +extends layout + +block content + h1= title + p Welcome to #{title} \ No newline at end of file