Commit 048b4d37 authored by Markus Opolka's avatar Markus Opolka
Browse files

Make API url central

parent 830ec60e
...@@ -4,6 +4,8 @@ LABEL maintainer="markus.opolka@fau.de" ...@@ -4,6 +4,8 @@ LABEL maintainer="markus.opolka@fau.de"
COPY . /app COPY . /app
WORKDIR /app WORKDIR /app
# This is so lazy...
RUN sed 's/localhost/geuselambix.phil.uni-erlangen.de/' src/main.js
RUN yarn install RUN yarn install
RUN yarn run build RUN yarn run build
......
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
// Call feature search API with parameters // Call feature search API with parameters
this.searching = true this.searching = true
let url = 'http://localhost:3000/api/features/' let url = 'api/features/'
// Adding the lettername to the API endpoint // Adding the lettername to the API endpoint
if (this.selected !== 'Toutes') { if (this.selected !== 'Toutes') {
url = url + this.selected url = url + this.selected
...@@ -168,14 +168,14 @@ export default { ...@@ -168,14 +168,14 @@ export default {
}, },
created () { created () {
// Get feature glossary // Get feature glossary
this.$http.get('http://localhost:3000/api/glossary/features').then(function (data) { this.$http.get('api/glossary/features').then(function (data) {
this.feature_categories_glossary = data.body.categories this.feature_categories_glossary = data.body.categories
this.feature_types_glossary = data.body.types this.feature_types_glossary = data.body.types
this.feature_subtypes_glossary = data.body.subtypes this.feature_subtypes_glossary = data.body.subtypes
}) })
// Create list of all letters // Create list of all letters
this.$http.get('http://localhost:3000/api/metadata/table').then(function (data) { this.$http.get('api/metadata/table').then(function (data) {
for (let letter of data.body) { for (let letter of data.body) {
if (letter.valid) { if (letter.valid) {
this.letters.push({text: letter.title}) this.letters.push({text: letter.title})
......
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
created () { created () {
// Get Name from Router and call API // Get Name from Router and call API
this.lettername = this.$route.params.letter this.lettername = this.$route.params.letter
this.$http.get('http://localhost:3000/api/letters/' + this.lettername).then(function (data) { this.$http.get('api/letters/' + this.lettername).then(function (data) {
// If there's only one element xml-js makes no array... great stuff -.- // If there's only one element xml-js makes no array... great stuff -.-
if (data.body.TEI.text.head.graphic instanceof Array) { if (data.body.TEI.text.head.graphic instanceof Array) {
......
...@@ -67,13 +67,13 @@ export default { ...@@ -67,13 +67,13 @@ export default {
reload () { reload () {
// Trigger Backend to reload cache // Trigger Backend to reload cache
this.reloading = true this.reloading = true
this.$http.get('http://localhost:3000/api/metadata/reload').then(function (data) { this.$http.get('api/metadata/reload').then(function (data) {
this.load(true) this.load(true)
}) })
}, },
load (snack) { load (snack) {
// Initial load of metadata // Initial load of metadata
this.$http.get('http://localhost:3000/api/metadata/table').then(function (data) { this.$http.get('api/metadata/table').then(function (data) {
this.letters = data.body this.letters = data.body
this.reloading = false this.reloading = false
this.snackbar = snack this.snackbar = snack
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
} }
}, },
created () { created () {
this.$http.get('http://localhost:3000/api/metadata/table').then(function (data) { this.$http.get('api/metadata/table').then(function (data) {
this.items = data.body this.items = data.body
}) })
} }
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
// Remove undefined values // Remove undefined values
Object.keys(params).forEach((key) => (params[key] == null) && delete params[key]) Object.keys(params).forEach((key) => (params[key] == null) && delete params[key])
this.searching = true this.searching = true
this.$http.get('http://localhost:3000/api/search/', {params: params}).then(function (data) { this.$http.get('api/search/', {params: params}).then(function (data) {
this.results = data.body this.results = data.body
this.searching = false this.searching = false
}) })
......
...@@ -11,10 +11,12 @@ import '../node_modules/vuetify/dist/vuetify.min.css' ...@@ -11,10 +11,12 @@ import '../node_modules/vuetify/dist/vuetify.min.css'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Vuetify) Vue.use(Vuetify)
Vue.use(VueResource)
Vue.component('feature', Feature) Vue.component('feature', Feature)
Vue.component('result', Result) Vue.component('result', Result)
Vue.use(VueResource)
Vue.http.options.root = 'http://localhost:3000'
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment