fix upload url

This commit is contained in:
Kieran 2023-01-29 19:52:26 +00:00
parent 385b4479ae
commit bc16134f6d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -5,19 +5,17 @@ export default async function NostrBuildUpload(file: File | Blob): Promise<Uploa
fd.append("fileToUpload", file);
fd.append("submit", "Upload Image");
let rsp = await fetch("https://nostr.build/api/upload/", {
let rsp = await fetch("https://nostr.build/api/upload/snort.php", {
body: fd,
method: "POST",
headers: {
"content-type": "multipart/form-data",
"accept": "application/json"
}
});
if(rsp.ok) {
let data = await rsp.json();
console.debug(data);
return {
url: data.url
url: new URL(data).toString()
}
}
return {