Skip to content

Commit 65c0810

Browse files
author
Lee Richmond
committed
Work within Rails app
1 parent ed3b51d commit 65c0810

File tree

6 files changed

+18
-65
lines changed

6 files changed

+18
-65
lines changed

public/index.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<!-- REPLACE FOR LOCAL DEV -->
8+
<!-- <meta name="schema" content="/api/v1/schema.json"> -->
9+
<meta name="schema" content="__SCHEMA_PATH__">
710
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
811
<title>vandal</title>
912
</head>
@@ -12,6 +15,13 @@
1215
<strong>We're sorry but vandal doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1316
</noscript>
1417
<div id="app"></div>
18+
19+
<script>
20+
if (window.location.href.indexOf('#') === -1) {
21+
window.location.href = window.location.href + '/#/'
22+
}
23+
</script>
24+
1525
<!-- built files will be auto injected -->
1626
</body>
17-
</html>
27+
</html>

src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $list-group-bg: $darkCard;
108108
109109
body {
110110
// height:100vh;
111-
background: url('/assets/img/squares.png');
111+
background: url('assets/img/squares.png');
112112
113113
.left-rail {
114114
flex-grow: 1;

src/router.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
import Vue from 'vue'
22
import Router from 'vue-router'
33
import All from './views/All.vue'
4-
import Demo from './views/Demo.vue'
54

65
Vue.use(Router)
76

87
export default new Router({
9-
mode: 'history',
10-
base: '/vandal',
8+
base: '',
119
routes: [
1210
{
1311
path: '/',
1412
name: 'vandal',
1513
component: All
16-
},
17-
{
18-
path: '/demo',
19-
name: 'demo',
20-
component: Demo
2114
}
2215
]
23-
})
16+
})

src/views/All.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ export default Vue.extend({
162162
}
163163
},
164164
created() {
165-
console.log('all created')
166165
this.fetchSchema()
167166
let doneCreating = () => { this.creating = false }
168167
setTimeout(doneCreating, 1000)
@@ -192,7 +191,8 @@ export default Vue.extend({
192191
headers.append('pragma', 'no-cache')
193192
headers.append('cache-control', 'no-cache')
194193
let init = { method: 'GET', headers }
195-
let request = new Request('/schema.json')
194+
let schemaPath = document.querySelector("meta[name='schema']").getAttribute("content");
195+
let request = new Request(schemaPath)
196196
let schemaJson = await (await fetch(request)).json()
197197
this.schema = new Schema(schemaJson)
198198
},

src/views/Demo.vue

-50
This file was deleted.

vue.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ module.exports = {
33
devServer: {
44
proxy: process.env.PROXY
55
},
6-
baseUrl: '/vandal'
7-
}
6+
baseUrl: ''
7+
}

0 commit comments

Comments
 (0)