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"
COPY . /app
WORKDIR /app
# This is so lazy...
RUN sed 's/localhost/geuselambix.phil.uni-erlangen.de/' src/main.js
RUN yarn install
RUN yarn run build
......
......@@ -126,7 +126,7 @@ export default {
// Call feature search API with parameters
this.searching = true
let url = 'http://localhost:3000/api/features/'
let url = 'api/features/'
// Adding the lettername to the API endpoint
if (this.selected !== 'Toutes') {
url = url + this.selected
......@@ -168,14 +168,14 @@ export default {
},
created () {
// 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_types_glossary = data.body.types
this.feature_subtypes_glossary = data.body.subtypes
})
// 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) {
if (letter.valid) {
this.letters.push({text: letter.title})
......
......@@ -142,7 +142,7 @@ export default {
created () {
// Get Name from Router and call API
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 (data.body.TEI.text.head.graphic instanceof Array) {
......
......@@ -67,13 +67,13 @@ export default {
reload () {
// Trigger Backend to reload cache
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)
})
},
load (snack) {
// 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.reloading = false
this.snackbar = snack
......
......@@ -87,7 +87,7 @@ export default {
}
},
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
})
}
......
......@@ -87,7 +87,7 @@ export default {
// Remove undefined values
Object.keys(params).forEach((key) => (params[key] == null) && delete params[key])
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.searching = false
})
......
......@@ -11,10 +11,12 @@ import '../node_modules/vuetify/dist/vuetify.min.css'
Vue.config.productionTip = false
Vue.use(Vuetify)
Vue.use(VueResource)
Vue.component('feature', Feature)
Vue.component('result', Result)
Vue.use(VueResource)
Vue.http.options.root = 'http://localhost:3000'
/* eslint-disable no-new */
new Vue({
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