Skip to content

Commit

Permalink
image uploader fallback on vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Feb 9, 2024
1 parent f14f0e2 commit 77ca613
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/storage/FileUploadInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ export default {
methods: {
async fallbackUpload() {
const thisAppUrl = window.location.origin;
const fetcherService = thisAppUrl + "/.netlify/functions/imageUploaderFallback";
let fetcherService;
if (this.$config.fileUploadTokenService === "netlify") {
fetcherService = thisAppUrl + "/.netlify/functions/imageUploaderFallback";
} else if (this.$config.fileUploadTokenService === "vercel") {
fetcherService = thisAppUrl + "/api/imageUploaderFallback";
}
const resp = await $fetch(fetcherService).catch((error) => error.data);
Expand Down

0 comments on commit 77ca613

Please sign in to comment.