issue-31 #35
@ -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
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user