Attempt to clarify installation instructions a little
[vchess.git] / client / src / router.js
CommitLineData
625022fd
BA
1import Vue from "vue";
2import Router from "vue-router";
625022fd
BA
3
4Vue.use(Router);
5
6function loadView(view) {
6808d7a1
BA
7 return () =>
8 import(/* webpackChunkName: "view-[request]" */ `@/views/${view}.vue`);
625022fd
BA
9}
10
786e0065 11const router = new Router({
625022fd
BA
12 routes: [
13 {
14 path: "/",
cf2343ce 15 name: "hall",
0705a80c 16 component: loadView("Hall")
625022fd 17 },
5b020e73
BA
18 {
19 path: "/variants",
20 name: "variants",
6808d7a1 21 component: loadView("Variants")
5b020e73 22 },
737a5daf
BA
23 {
24 path: "/variants/list",
25 name: "variantlist",
26 component: loadView("VariantList")
27 },
cf2343ce
BA
28 {
29 path: "/variants/:vname([a-zA-Z0-9]+)",
30 name: "rules",
6808d7a1 31 component: loadView("Rules")
cf2343ce 32 },
1aeed627
BA
33 {
34 path: "/authenticate/:token",
35 name: "authenticate",
6808d7a1 36 component: loadView("Auth")
a3ac374b
BA
37 },
38 {
39 path: "/logout",
40 name: "logout",
6808d7a1 41 component: loadView("Logout")
1aeed627 42 },
89021f18
BA
43 {
44 path: "/problems",
45 name: "myproblems",
6808d7a1 46 component: loadView("Problems")
89021f18 47 },
afd3240d
BA
48 {
49 path: "/mygames",
50 name: "mygames",
6808d7a1 51 component: loadView("MyGames")
afd3240d 52 },
f7121527 53 {
71468011 54 path: "/game/:id([a-zA-Z0-9]+)",
f7121527 55 name: "game",
6808d7a1 56 component: loadView("Game")
f7121527 57 },
afd3240d 58 {
677fe285
BA
59 path: "/analyse/:vname([a-zA-Z0-9]+)",
60 name: "analyse",
6808d7a1 61 component: loadView("Analyse")
afd3240d 62 },
92a523d1
BA
63 {
64 path: "/about",
65 name: "about",
6808d7a1 66 component: loadView("About")
92a523d1 67 },
604b951e 68 {
ff0150d1
BA
69 path: "/faq",
70 name: "faq",
71 component: loadView("Faq")
6808d7a1 72 }
625022fd
BA
73 ]
74});
786e0065 75
786e0065 76export default router;