роутинг, исправления в занесении торрентов

This commit is contained in:
Alexey Kasyanchuk
2017-01-01 09:51:02 +03:00
parent 2b861167cd
commit 6fc2d2efb4
8 changed files with 218 additions and 30 deletions

21
src/router.js Normal file
View File

@ -0,0 +1,21 @@
import router from 'page';
window.router = router;
import PagesPie from './pages-pie.js';
import IndexPage from './index-page.js'
import TorrentPage from './torrent-page.js'
router('/', () => {
//singleton
let pie = new PagesPie;
pie.open(IndexPage, {replace: 'all'});
});
router('/torrent/:hash', (e) => {
//singleton
let pie = new PagesPie;
pie.open(TorrentPage, {
replace: 'all',
hash: e.params.hash,
});
});