Permalink
Browse files

add more example files

  • Loading branch information...
1 parent 48409ce commit 921936c4df198eb9dfa01d695f945d2d5a3b207a @cfsghost committed Aug 2, 2012
Showing with 36 additions and 0 deletions.
  1. +17 −0 examples/routes/method.js
  2. +19 −0 examples/routes/middleware.js
View
@@ -0,0 +1,17 @@
+
+module.exports = {
+ '/method': {
+ get: get,
+ post: post
+ }
+};
+
+function get(req, res) {
+
+ res.end('GET Method');
+};
+
+function post(req, res) {
+
+ res.end('POST Method');
+};
@@ -0,0 +1,19 @@
+
+module.exports = {
+ '/middleware': [
+ DoSomethingBeforeHandler,
+ middleware
+ ]
+};
+
+function DoSomethingBeforeHandler(req, res, next) {
+
+ console.log('Do Something');
+
+ next();
+};
+
+function middleware(req, res) {
+
+ res.render('index', { title: 'Courser Example' });
+};

0 comments on commit 921936c

Please sign in to comment.