Browse Source

Changed API url from localhost to server IP address

James Peret 2 years ago
parent
commit
c5a64f6ec5
1 changed files with 5 additions and 4 deletions
  1. 5 4
      themes/kairoscope-theme/layout/_partial/vue.ejs

+ 5 - 4
themes/kairoscope-theme/layout/_partial/vue.ejs

@@ -3,6 +3,7 @@
     var app = new Vue({
         el: '#vue-app',
         data: {
+            api_host : "http://192.241.167.183",
             newsletter: {
                 email : '',
                 alert_class : 'alert-secondary',
@@ -57,7 +58,7 @@
                     var payload = { email: this.newsletter.email }
                     console.log("Subscribing to newsletter", payload);
                     var req = new XMLHttpRequest();
-                    req.open('POST', "http://localhost:3101/register", true);
+                    req.open('POST', `${this.api_host}/register`, true);
                     req.setRequestHeader('Content-Type', 'application/json');
                     var res = undefined;
                     req.onreadystatechange  = function() {
@@ -130,7 +131,7 @@
                 this.contact.message.send_status = "sending";
                 var vm = this;
                 var req = new XMLHttpRequest();
-                    req.open('POST', "http://localhost:3102/receive", true);
+                    req.open('POST', `${this.api_host}/receive`, true);
                     req.setRequestHeader('Content-Type', 'application/json');
                     req.onreadystatechange = function() {
                         if(req.status == 200) {
@@ -153,7 +154,7 @@
                 this.contact.feedback.send_status = "sending";
                 var vm = this;
                 var req = new XMLHttpRequest();
-                    req.open('POST', "http://localhost:3102/receive", true);
+                    req.open('POST', `${this.api_host}/receive`, true);
                     req.setRequestHeader('Content-Type', 'application/json');
                     req.onreadystatechange  = function() {
                         if(req.status == 200) {
@@ -176,7 +177,7 @@
                 this.contact.report.send_status = "sending";
                 var vm = this;
                 var req = new XMLHttpRequest();
-                    req.open('POST', "http://localhost:3102/receive", true);
+                    req.open('POST', `${this.api_host}/receive`, true);
                     req.setRequestHeader('Content-Type', 'application/json');
                     req.onreadystatechange  = function() {
                         if(req.status == 200) {