API Route reading back Filename as query #15412
Unanswered
SceptreData
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys! I've been having a bit of trouble with dynamic api routes. Here's what I'm trying to do:
Using the cloudinary upload widget, I'm trying to set up a custom API route to add the cloudinary image response into my firebase databse. This is done by giving the cloudinary widget a notifcation url. I'm trying to use a dynamic API route to as the notification URL, so when I upload an image I receive the response at something like this: {BaseUrl}/api/uploadImage/[name].js .
Then the idea is to catch the name from req.query... but I don't seem to get the right values for name out of the query.
When I log out the value of req.query, I see:
Firebase then throws an error because it can't parse the square brackets- but I'm not sure why '[name].js' is showing up in my query at all.
Any idea why this is happening?
Here is my API route code:
And here is where I initialize the cloudinary widget: Note the notification_url, which should be my dynamic API route:
Here is an image of the error being thrown on my Vercel dashboard:

Any idea what's up?
Beta Was this translation helpful? Give feedback.
All reactions