File tree Expand file tree Collapse file tree 2 files changed +55
-12
lines changed Expand file tree Collapse file tree 2 files changed +55
-12
lines changed Original file line number Diff line number Diff line change 1
1
import Vue from 'vue'
2
2
import Router from 'vue-router'
3
3
import Index from './views/index.vue'
4
- import Error404 from './views/errors/404.vue'
4
+
5
+ import Error404 from './views/errors/error404.vue'
6
+ import Maintenance from './views/errors/maintenance.vue'
5
7
6
8
Vue . use ( Router )
7
9
8
- const router = new Router ( {
9
- mode : 'history' ,
10
- routes : [
11
- {
12
- path : '/' ,
13
- name : 'index' ,
14
- component : Index
15
- } ,
10
+ /**
11
+ * Routing
12
+ */
13
+ let routes = [
14
+ {
15
+ path : '/' ,
16
+ component : Index
17
+ } ,
18
+ {
19
+ path : '*' ,
20
+ component : Error404 ,
21
+ }
22
+ ] ;
23
+
24
+ /**
25
+ * Down for maintenance mode via .env
26
+ */
27
+ if ( process . env . VUE_APP_MAINTENANCE_MODE ) {
28
+ routes = [
16
29
{
17
30
path : '*' ,
18
- component : Error404 ,
19
- } ,
20
- ]
31
+ component : Maintenance ,
32
+ }
33
+ ] ;
34
+ }
35
+
36
+ let router = new Router ( {
37
+ mode : 'history' ,
38
+ routes,
21
39
} )
22
40
export default router
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <div class =" container px-4 pt-20 text-center" >
4
+ <h1 class =" text-3xl md:text-6xl font-bold text-gray-200" >
5
+ Down for maintenance
6
+ </h1 >
7
+ <p class =" max-w-md mx-auto" >
8
+ Sorry, we're down for scheduled maintenance. Please  ; check  ; back  ; soon.
9
+ </p >
10
+ </div >
11
+ </div >
12
+ </template >
13
+
14
+ <script >
15
+ export default {
16
+ name: ' Maintenance' ,
17
+ components: {
18
+ },
19
+ metaInfo () {
20
+ return {
21
+ title: this .$siteName ,
22
+ };
23
+ },
24
+ }
25
+ </script >
You can’t perform that action at this time.
0 commit comments