Browse Source

proxy die x-te

test1
Georg Spar 1 year ago
parent
commit
9b5a96aea9
  1. 8
      components/Typ.vue
  2. 10
      nuxt.config.js

8
components/Typ.vue

@ -68,14 +68,14 @@
async fetch() {
console.log("fetching...");
this.certs = await fetch(
'http://10.1.1.13:8081/api/v1/typ'
'http://ubodroid-2:8080/api/v1/typ'
).then(res => res.json())
},
async onSubmit() {
// event.preventDefault();
this.form.id = "";
console.log("submitting...");
await this.$http.$post('http://10.1.1.13:8081/api/v1/typ', this.form);
await this.$http.$post('http://ubodroid-2:8080/api/v1/typ', this.form);
// return result;
// this.subm(this.form);
this.fetch();
@ -87,7 +87,7 @@
console.log("updating...");
console.log("Laufzeit: ", this.form.laufzeit)
console.log(this.form);
await this.$http.$put('http://10.1.1.13:8081/api/v1/typ/'+this.form.id, this.form);
await this.$http.$put('http://ubodroid-2:8080/api/v1/typ/'+this.form.id, this.form);
// return result;
// this.subm(this.form);
this.fetch();
@ -97,7 +97,7 @@
async onDelete() {
// event.preventDefault();
console.log("updating...");
await this.$http.$delete('http://10.1.1.13:8081/api/v1/typ/'+this.form.id);
await this.$http.$delete('http://ubodroid-2:8080/api/v1/typ/'+this.form.id);
// return result;
// this.subm(this.form);
this.fetch();

10
nuxt.config.js

@ -51,13 +51,13 @@ export default {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
//baseURL: '/',
//browserBaseURL: '/',
//proxy: true
proxy: true
},
/*proxy: [
//'/api/v1/': { target: 'http://10.1.1.13:8081/', changeOrigin: true },
'http://10.1.1.13:8081/api/'
],*/
proxy: {
'/api/v1/': { target: 'http://10.1.1.13:8081/', changeOrigin: true },
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {

Loading…
Cancel
Save