-
Notifications
You must be signed in to change notification settings - Fork 640
/
Copy pathrouter.js
67 lines (60 loc) · 2.07 KB
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}
Router.map(function () {
this.route('crates');
this.route('crate', { path: '/crates/:crate_id' }, function () {
this.route('versions');
this.route('dependencies');
this.route('version', { path: '/:version_num' });
this.route('version-dependencies', { path: '/:version_num/dependencies' });
this.route('range', { path: '/range/:range' });
this.route('reverse-dependencies', { path: 'reverse_dependencies' });
this.route('owners');
this.route('settings');
this.route('delete');
// Well-known routes
this.route('docs');
this.route('repo');
});
this.route('me', function () {
this.route('crates');
this.route('following');
this.route('pending-invites');
});
this.route('settings', function () {
this.route('email-notifications');
this.route('profile');
this.route('tokens', function () {
this.route('new');
});
});
this.route('user', { path: '/users/:user_id' });
this.route('install');
this.route('search');
this.route('dashboard');
this.route('keywords');
this.route('keyword', { path: '/keywords/:keyword_id' }, function () {
this.route('index', { path: '/' });
});
this.route('categories');
this.route('category', { path: '/categories/:category_id' }, function () {
this.route('index', { path: '/' });
});
this.route('category-slugs', { path: 'category_slugs' });
this.route('team', { path: '/teams/:team_id' });
this.route('policies', function () {
this.route('security');
});
// The canonical security page is `/policies/security`; this is a redirect to support guessing
// of the URL to be `/security`.
this.route('security');
this.route('data-access');
this.route('confirm', { path: '/confirm/:email_token' });
this.route('accept-invite', { path: '/accept-invite/:token' });
this.route('support');
this.route('catch-all', { path: '*path' });
});