Browse Source

proxy aus, richtige Adressen eingetragen

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

8
components/Typ.vue

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

9
nuxt.config.js

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

Loading…
Cancel
Save