Skip to content

Commit

Permalink
html: Use relative path and not global
Browse files Browse the repository at this point in the history
Fix redirect calls when using a HTTP server

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Jun 22, 2021
1 parent 0c8ad5d commit 280e985
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
By: {{formatAuthors(info.service.authors)}}<br />
Check the <a href="\mavlink">mavlink path</a> for the data<br />
You can also check nested paths:
<a href="/mavlink/vehicles/1/components/1/messages/HEARTBEAT/message/mavtype/type"
>/mavlink/vehicles/{system_id}/components/{component_id}/messages/HEARTBEAT/message/mavtype/type</a
<a href="mavlink/vehicles/1/components/1/messages/HEARTBEAT/message/mavtype/type"
>mavlink/vehicles/{system_id}/components/{component_id}/messages/HEARTBEAT/message/mavtype/type</a
><br />
</div>
</div>
Expand Down Expand Up @@ -60,12 +60,11 @@
<script src="vue.js"></script>
<script>
/*global Vue*/
const API = `${window.location.protocol}//${window.location.host}`
const app = Vue.createApp({
mounted () {
this.requestData()

fetch(`${API}/info`).then(
fetch('info').then(
function (response) {
response.json().then((info) => this.info = info)
}.bind(this),
Expand All @@ -91,7 +90,7 @@
async requestData () {
setTimeout(
function () {
fetch(`${API}/mavlink`).then(
fetch('mavlink').then(
function (response) {
response.json().then((data) => this.data = data)
}.bind(this),
Expand Down

0 comments on commit 280e985

Please sign in to comment.