Browse Source

fix(spa): set api url to constant

master
Shalma 3 years ago
parent
commit
d1cd9877cd
  1. 4
      spa/src/components/Converter.vue

4
spa/src/components/Converter.vue

@ -1,6 +1,8 @@
<script setup> <script setup>
import { ref, watch, reactive } from 'vue' import { ref, watch, reactive } from 'vue'
const url = 'http://localhost:3000'
const result = ref(null) const result = ref(null)
const number_to_convert = ref(null) const number_to_convert = ref(null)
const error = ref(false) const error = ref(false)
@ -32,7 +34,7 @@ async function convertNumber() {
} }
try { try {
const res = await fetch('http://127.0.0.1:3000', options) const res = await fetch(url, options)
const roman = await res.text() const roman = await res.text()
result.value = roman result.value = roman
last_results.push({ arabic: number_to_convert.value, roman }) last_results.push({ arabic: number_to_convert.value, roman })

Loading…
Cancel
Save