issue-31 #35

Merged
y merged 3 commits from issue-31 into main 2024-05-15 11:02:48 +00:00
Showing only changes of commit 4e7f9d650e - Show all commits

View File

@ -18,8 +18,8 @@ export const uploadToFileStorage = async (
const unixNow = Math.floor(Date.now() / 1000)
// Create a File object with the Blob data
const file = new File([blob], `zipped-${unixNow}.zip`, {
type: 'application/zip'
const file = new File([blob], `compressed-${unixNow}.sigit`, {
type: 'application/sigit'
})
// Define event metadata for authorization
@ -39,13 +39,13 @@ export const uploadToFileStorage = async (
const authEvent = await nostrController.signEvent(event)
// URL of the file storage service
const FILE_STORAGE_URL = 'https://blossom.sigit.io'
const FILE_STORAGE_URL = 'https://blossom.sigit.io' // REFACTOR: should be an env
// Upload the file to the file storage service using Axios
const response = await axios.put(`${FILE_STORAGE_URL}/upload`, file, {
headers: {
Authorization: 'Nostr ' + btoa(JSON.stringify(authEvent)), // Set authorization header
'Content-Type': 'application/zip' // Set content type header
'Content-Type': 'application/sigit' // Set content type header
}
})