fix: change from localhost to the actual website

This commit is contained in:
Leon Xu committed 2023-01-30 16:12:27 -08:00
1 parent 684b39c4fc
commit cd5a41354b
1 file changed
+10 -7
+10 -7
View File
@@ -60,13 +60,16 @@ const CreatePost = () => {
if (form.prompt) {
try {
setGeneratingImg(true);
const response = await fetch("http://localhost:8000/api/v1/dalle", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ prompt: form.prompt }),
});
const response = await fetch(
"https://dalle-image-generator-server.onrender.com/api/v1/dalle",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ prompt: form.prompt }),
}
);
const data = await response.json();
setForm({ ...form, photo: `data:image/jpeg;base64,${data.photo}` });
} catch (error) {