Web Route example
# | Path | Type | Permissions | Auth | Controller |
---|---|---|---|---|---|
1 | WEB | [] | false | HomeController | |
2 | WEB | [] | false | HomeController | |
3 | WEB | [] | false | HomeController | |
4 | WEB | [] | false | HomeController | |
5 | WEB | [] | false | HomeController | |
6 | WEB | [] | false | HomeController | |
7 | WEB | [] | false | HomeController | |
8 | WEB | [] | false | HomeController | |
9 | WEB | [] | false | HomeController | |
10 | WEB | [] | false | HomeController | |
11 | API | [] | false | Future |
|
12 | API | [] | false | info | |
13 | API | [] | false | addNewPerson | |
14 | API | [] | false | deletePerson | |
15 | API | [] | false | replacePerson | |
16 | API | [] | false | onePerson | |
17 | API | [] | false | onePerson | |
18 | API | [] | false | allPerson | |
19 | WEB | [] | false | index | |
20 | WEB | [] | false | index | |
21 | WEB | [] | false | index | |
22 | WEB | [] | false | index | |
23 | WEB | [] | false | index | |
24 | WEB | [] | false | index | |
25 | WEB | [] | false | index | |
26 | WEB | [] | false | index | |
27 | WEB | [] | false | index | |
28 | WEB | [] | false | index | |
29 | WEB | [] | false | changeLanguage | |
30 | WEB | [] | false | changeLanguage | |
31 | WEB | [] | false | changeLanguage | |
32 | WEB | [] | false | changeLanguage | |
33 | WEB | [] | false | Future |
|
34 | WEB | [] | false | exampleCookie | |
35 | WEB | [] | false | exampleAddCookie | |
36 | WEB | [] | false | exampleAddCookie | |
37 | WEB | [] | false | exampleDatabase | |
38 | WEB | [] | false | exampleDatabase | |
39 | WEB | [] | false | exampleDatabase | |
40 | WEB | [] | false | exampleDatabase | |
41 | WEB | [] | false | exampleDump | |
42 | WEB | [] | false | exampleEmailSend | |
43 | WEB | [] | false | exampleEmail | |
44 | WEB | [] | false | exampleError | |
45 | WEB | [] | false | exampleForm | |
46 | WEB | [] | false | loginPost | |
47 | WEB | [] | false | Future |
|
48 | WEB | [] | false | Future |
|
49 | WEB | [] | false | Future |
|
50 | WEB | [] | false | Future |
|
51 | WEB | [] | false | Future |
|
52 | WEB | [] | false | Future |
|
53 | WEB | [] | false | Future |
|
54 | WEB | [] | false | Future |
|
55 | WEB | [] | false | Future |
|
56 | WEB | [] | false | Future |
|
57 | WEB | [] | false | Future |
|
58 | WEB | [] | false | Future |
|
59 | WEB | [] | false | Future |
|
60 | WEB | [] | false | Future |
|
61 | WEB | [] | false | Future |
|
62 | WEB | [] | false | Future |
|
63 | WEB | [] | false | Future |
|
64 | WEB | [] | false | Future |
|
65 | WEB | [] | false | Future |
|
66 | WEB | [] | false | Future |
|
67 | WEB | [] | false | exampleLanguage | |
68 | WEB | [] | false | paginationExample | |
69 | WEB | [admin] | true | exampleAuth | |
70 | WEB | [admin] | true | exampleAuth | |
71 | WEB | [admin] | true | exampleAuth | |
72 | WEB | [admin] | true | exampleAuth | |
73 | WEB | [admin] | true | exampleAuth | |
74 | WEB | [admin] | true | exampleAuth | |
75 | WEB | [admin] | true | exampleAuth | |
76 | WEB | [admin] | true | exampleAuth | |
77 | WEB | [admin] | true | exampleAuth | |
78 | WEB | [admin] | true | exampleAuth | |
79 | WEB | [] | false | allPerson | |
80 | WEB | [] | false | addNewPerson | |
81 | WEB | [] | false | deletePerson | |
82 | WEB | [] | false | replacePerson | |
83 | WEB | [] | false | onePerson | |
84 | WEB | [] | false | onePerson | |
85 | WEB | [] | false | allPerson | |
86 | WEB | [] | false | exampleRoute | |
87 | WEB | [] | false | exampleSocket | |
88 | WEB | [] | false | changeLanguage | |
89 | WEB | [] | false | changeLanguage | |
90 | WEB | [] | false | changeLanguage | |
91 | WEB | [] | false | info | |
92 | WEB | [] | false | changeLanguage | |
93 | WEB | [] | false | changeLanguage | |
94 | WEB | [] | false | changeLanguage | |
95 | WEB | [] | false | logout | |
96 | WEB | [] | false | logout | |
97 | WEB | [] | false | logout | |
98 | WEB | [] | false | logout | |
99 | WEB | [] | false | logout | |
100 | WEB | [] | false | logout | |
101 | WEB | [] | false | logout | |
102 | WEB | [] | false | logout | |
103 | WEB | [] | false | logout | |
104 | WEB | [] | false | logout | |
105 | WEB | [] | false | changeLanguage | |
106 | WEB | [] | false | changeLanguage | |
107 | WEB | [] | false | Future |
|
108 | WEB | [] | false | changeLanguage | |
109 | WEB | [] | false | socket | |
110 | WEB | [] | false | socket | |
111 | WEB | [] | false | socket | |
112 | WEB | [] | false | socket | |
113 | WEB | [] | false | socket | |
114 | WEB | [] | false | socket | |
115 | WEB | [] | false | socket | |
116 | WEB | [] | false | socket | |
117 | WEB | [] | false | socket | |
118 | WEB | [] | false | socket | |
119 | WEB | [] | false | changeLanguage |
-
Router example/lib/route/web_route.dart
import 'package:webapp/wa_route.dart';
import '../controllers/home_controller.dart';
Future> getWebRoute(WebRequest rq) async {
final homeController = HomeController(rq);
final includeController = IncludeJsController(rq);
var paths = [
WebRoute(
path: 'ws',
methods: RequestMethods.ALL,
rq: rq,
index: homeController.socket,
),
WebRoute(
path: 'app/includes.js',
methods: RequestMethods.ALL,
rq: rq,
index: includeController.index,
),
WebRoute(
path: 'example',
rq: rq,
index: () => rq.redirect('/'),
children: [
WebRoute(
path: '/form',
methods: RequestMethods.ALL,
rq: rq,
index: homeController.exampleForm,
),
WebRoute(
path: '/cookie',
methods: RequestMethods.ONLY_GET,
rq: rq,
index: homeController.exampleCookie,
),
WebRoute(
path: '/cookie',
methods: RequestMethods.ONLY_POST,
rq: rq,
index: homeController.exampleAddCookie,
),
WebRoute(
path: '/cookie',
methods: RequestMethods.ONLY_GET,
rq: rq,
index: homeController.exampleAddCookie,
),
WebRoute(
path: '/route',
methods: RequestMethods.ONLY_GET,
rq: rq,
index: homeController.exampleRoute,
),
WebRoute(
path: '/socket',
methods: RequestMethods.ONLY_GET,
rq: rq,
index: homeController.exampleSocket,
),
WebRoute(
path: '/email',
methods: RequestMethods.ONLY_GET,
rq: rq,
index: homeController.exampleEmail,
),
WebRoute(
path: '/email',
methods: RequestMethods.ONLY_POST,
rq: rq,
index: homeController.exampleEmailSend,
),
],
),
WebRoute(
path: 'info',
extraPath: ['api/info'],
rq: rq,
index: homeController.info,
),
];
return [
WebRoute(
path: '/',
rq: rq,
methods: RequestMethods.ALL,
controller: homeController,
children: [
...paths,
WebRoute(
path: 'fa/*',
extraPath: [
'en/*',
'nl/*',
],
rq: rq,
index: homeController.changeLanguage,
)
],
),
];
}