-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
121o36bh27c5ejtr3g0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Meteor packages used by this project, one per line. | ||
# | ||
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
standard-app-packages | ||
autopublish | ||
insecure | ||
iron:router | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* CSS declarations go here */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<head> | ||
<title>middleware</title> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
<template name="Home"> | ||
<h1>Home Page</h1> | ||
|
||
<p> | ||
Check out the JavaScript console | ||
</p> | ||
</template> | ||
|
||
<template name="NoRouteFound"> | ||
<h1> | ||
Sorry, no route was found for "{{url}}" on the client or the server! | ||
</h1> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// middleware on the server which uses the same api as Connect | ||
// middleware | ||
Router.use(function (req, res, next) { | ||
// we use the connect middleware req, res objects here | ||
console.log(req.method + ": " + req.url); | ||
next(); | ||
|
||
// or, the request, response and next functions are also | ||
// attached to "this": this.request, this.response, this.next() | ||
}, {where: 'server'}); | ||
|
||
Router.route('/file', function () { | ||
this.response.end("here's your file...\n"); | ||
}, {where: 'server'}); | ||
|
||
|
||
// middlware on the client | ||
Router.use(function () { | ||
console.log('Middleware on the client with url: ', this.url); | ||
this.next(); | ||
}); | ||
|
||
Router.route('/', function () { | ||
this.render('Home'); | ||
}); | ||
|