Skip to content

Commit

Permalink
Update example with the usage of ^.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsm committed Nov 10, 2015
1 parent e8ada5d commit bd86d82
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion example/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var Account = module.exports = Service.extend({
}
},

'get::/logout': function logout(req, res) {
'get::^/logout': function logout(req, res) {
req.logout();
res.redirect('/account/login');
},
Expand Down
2 changes: 1 addition & 1 deletion example/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cookie-parser": "^1.3.5",
"express-session": "^1.11.3",
"jade": "^1.11.0",
"micromono": "0.1.28",
"micromono": "0.1.x",
"passport": "^0.2.2",
"passport-local": "^1.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion example/account/view/hello.jade
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h2 /account/protected
h3 Hello #{name}, you can not see this page unless you have logged in successfully.
h4 Click to
a(href="/account/logout") Logout
a(href="/logout") Logout
8 changes: 4 additions & 4 deletions example/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ var account = new Account();
*/
var Home = module.exports = Service.extend({
packagePath: __dirname,
baseUrl: '/',
baseUrl: '/home',

use: {
// tell micromono to use `layout` middleware at the server side
// for request urls in the array.
'layout': ['/private', '/public$', '/$']
'layout': ['/private$', '^/public$', '^/$']
},

route: {
Expand All @@ -41,14 +41,14 @@ var Home = module.exports = Service.extend({
});
}],

'get::/public': function public(req, res) {
'get::^/public': function public(req, res) {
res.render('page', {
title: 'Home Public Page',
name: 'anonymouse'
});
},

'get::/': function index(req, res) {
'get::^/': function index(req, res) {
res.render('index');
}
},
Expand Down
2 changes: 1 addition & 1 deletion example/home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"body-parser": "^1.13.2",
"jade": "^1.11.0",
"micromono": "0.1.28"
"micromono": "0.1.x"
},
"devDependencies": {
"jspm": "0.15.7"
Expand Down
2 changes: 1 addition & 1 deletion example/home/view/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ h3 Index Page of Home Service

ul
li
a(href="/private") Home Private Page
a(href="/home/private") Home Private Page
li
a(href="/public") Home Public Page
li
Expand Down
8 changes: 4 additions & 4 deletions example/io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"dependencies": {
"jade": "^1.11.0",
"micromono": "0.1.28",
"micromono": "0.1.30",
"socket.io": "1.3.6"
},
"jspm": {
Expand All @@ -14,9 +14,9 @@
"socket.io-client": "github:socketio/socket.io-client@^1.3.6"
},
"devDependencies": {
"babel": "npm:babel-core@^5.8.24",
"babel-runtime": "npm:babel-runtime@^5.8.24",
"core-js": "npm:core-js@^1.1.4"
"babel": "npm:[email protected].29",
"babel-runtime": "npm:[email protected].29",
"core-js": "npm:core-js@1.2.3"
}
}
}
8 changes: 4 additions & 4 deletions example/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"express": "^4.13.1",
"jade": "^1.11.0",
"jspm": "^0.15.7",
"micromono": "0.1.28"
"micromono": "0.1.x"
},
"micromono": {
"publicURL": "/public"
Expand All @@ -26,9 +26,9 @@
"socket.io-client": "github:socketio/socket.io-client@^1.3.6"
},
"devDependencies": {
"babel": "npm:babel-core@^5.1.13",
"babel-runtime": "npm:babel-runtime@^5.1.13",
"core-js": "npm:core-js@^0.9.4"
"babel": "npm:babel-core@5.8.29",
"babel-runtime": "npm:babel-runtime@5.8.29",
"core-js": "npm:core-js@1.2.3"
}
}
}

0 comments on commit bd86d82

Please sign in to comment.