first full roundtrip

This commit is contained in:
Robin Linus 2015-12-19 01:18:02 +01:00
parent dd4809f519
commit dc1af5ae7b
19 changed files with 222 additions and 450 deletions

View file

@ -1,13 +1,3 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script src="../bower_components/page/page.js"></script>
<script>
window.addEventListener('WebComponentsReady', function() {
@ -21,21 +11,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
page.base(app.baseUrl.replace(/\/$/, ''));
}
// Middleware
function scrollToTop(ctx, next) {
app.scrollPageToTop();
next();
}
function closeDrawer(ctx, next) {
app.closeDrawer();
next();
}
// Routes
page('*', scrollToTop, closeDrawer, function(ctx, next) {
next();
});
page('/', function() {
app.route = 'home';
@ -45,18 +20,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
app.route = 'home';
});
page('/users', function() {
app.route = 'users';
});
page('/users/:name', function(data) {
app.route = 'user-info';
app.params = data.params;
});
page('/contact', function() {
app.route = 'contact';
});
// 404
page('*', function() {