chore: put backend host in an environment variable
All checks were successful
/ build-and-push-image (push) Successful in 23s

This commit is contained in:
log101 2024-06-11 12:02:02 +03:00
parent 7ebe19f905
commit f831e4685f

View File

@ -15,6 +15,8 @@ export async function getStaticPaths() {
props: { entry },
}));
}
const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
---
<style>
@ -34,13 +36,13 @@ export async function getStaticPaths() {
<Post post={entry} componentType="full" />
<form
hx-post="http://localhost:8000/blog/api/forms/emoji/post"
hx-post=`${backendHost}/blog/api/forms/emoji/post`
hx-target="#reaction-buttons"
>
<input type="hidden" name="postId" value=`${entry.id}` />
<div
id="reaction-buttons"
hx-get=`http://localhost:8000/blog/api/forms/emoji?postId=${entry.id}`
hx-get=`${backendHost}/blog/api/forms/emoji?postId=${entry.id}`
hx-trigger="load"
hx-swap="innerHTML"
>