Use proper urls
This commit is contained in:
@ -4,13 +4,16 @@ import StreamPreviewVue from '@/components/StreamPreview.vue'
|
||||
|
||||
export default {
|
||||
async setup() {
|
||||
const res = await fetch(`${import.meta.env.VITE_BACKEND_URL}/api/discover`)
|
||||
const protocol = import.meta.env.VITE_HTTPS === 'true' ? 'https://' : 'http://'
|
||||
|
||||
const res = await fetch(`${protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/discover`)
|
||||
let data: Ref<any[] | undefined> = ref()
|
||||
let frontend_url = import.meta.env.VITE_INSTANCE_URL
|
||||
let frontend_url = protocol + import.meta.env.VITE_INSTANCE_DOMAIN
|
||||
data.value = await res.json()
|
||||
|
||||
return {
|
||||
data,
|
||||
protocol,
|
||||
frontend_url,
|
||||
filterTags: '',
|
||||
following: ref([])
|
||||
@ -62,7 +65,7 @@ export default {
|
||||
const cursor = this.data[this.data.length - 1].cursor
|
||||
if (!cursor) return
|
||||
const res = await fetch(
|
||||
`${import.meta.env.VITE_BACKEND_URL}/api/discover/?cursor=${cursor}`
|
||||
`${this.protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/discover/?cursor=${cursor}`
|
||||
)
|
||||
const data = await res.json()
|
||||
|
||||
|
Reference in New Issue
Block a user