trying to get json from api
This commit is contained in:
@@ -14,9 +14,10 @@ module.exports = merge(baseConfig, {
|
|||||||
hot: true,
|
hot: true,
|
||||||
contentBase: 'dist',
|
contentBase: 'dist',
|
||||||
compress: true,
|
compress: true,
|
||||||
|
// host: 'dev.gdp.fr',
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: PORT,
|
port: PORT,
|
||||||
// disableHostCheck: true,
|
disableHostCheck: true,
|
||||||
// open: "firefox-developer-edition",
|
// open: "firefox-developer-edition",
|
||||||
overlay: { warnings: false, errors: true },
|
overlay: { warnings: false, errors: true },
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
let path = 'http://' + window.location.hostname + ':8984'
|
// let path = 'http://' + window.location.hostname + ':8984'
|
||||||
|
let path = 'http://dev.api.gdp.fr'
|
||||||
|
|
||||||
export const REST = axios.create({
|
export const REST = axios.create({
|
||||||
baseURL: path + '/gdp',
|
baseURL: path + '/gdp',
|
||||||
withCredentials: true,
|
// withCredentials: true,
|
||||||
crossDomain: true,
|
crossorigin: true,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
// 'Access-Control-Allow-Credentials': true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,12 +6,36 @@
|
|||||||
<h1>Bibliographie</h1>
|
<h1>Bibliographie</h1>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import { REST } from 'api/rest-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Bibliographie',
|
name: 'Bibliographie',
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
||||||
})
|
}),
|
||||||
|
beforeCreate () {
|
||||||
|
// ?_format=json
|
||||||
|
REST.get(`/bibliography/works`, {})
|
||||||
|
.then(({ data }) => {
|
||||||
|
console.log('Biblio REST: data', data)
|
||||||
|
// if(data.length){
|
||||||
|
// commit('setItems',data)
|
||||||
|
// // console.log('items.length', this.items.length);
|
||||||
|
// if(state.infiniteLoadingState)
|
||||||
|
// state.infiniteLoadingState.loaded()
|
||||||
|
// }else{
|
||||||
|
// if(state.infiniteLoadingState)
|
||||||
|
// state.infiniteLoadingState.complete()
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.warn('Issue with operum', error)
|
||||||
|
Promise.reject(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default {
|
|||||||
|
|
||||||
}),
|
}),
|
||||||
beforeCreate () {
|
beforeCreate () {
|
||||||
|
// ?_format=json
|
||||||
REST.get(`/indexOperum`, {})
|
REST.get(`/indexOperum`, {})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('operum REST: data', data)
|
console.log('operum REST: data', data)
|
||||||
|
|||||||
Reference in New Issue
Block a user