Api endpoints and [id] routes in production
Answered
Japanese jack mackerel posted this in #help-forum
Japanese jack mackerelOP
Hello my app works fine locally but mid production i can't access the [id] route for each project, it fetches the data but doesn't redirect me to the [id] route i get this error
47 Replies
Japanese jack mackerelOP
i don't even understand what that means 🥲
do you use that function?
or use a lib that could use it like nuqs
Japanese jack mackerelOP
works fine locally
Where is the redirect+ on local build is it still fine (next build && next start)
Japanese jack mackerelOP
well on the [id]/page.tsx there isn't any specific useSearchParams i use it on the components imported in that page
and this is how hero compoenent imports the title
locacly it works
could the problem be in my api?
Answer
@riský really should remove this line
Japanese jack mackerelOP
yea am removing it from components that are used in /[id] route
@riský really should remove this line
Japanese jack mackerelOP
nice its working now kinda the routes works but doesn't fetch the image c:
Japanese jack mackerelOP
this doesn't work in production?
where is the
project.title coming fromsaving as in file uploads? or static files?
cause public dir isn't supposed to be used for file storage
only static files
okay, you're calling an api with the form data... where are the files actually getting stored?
you are using fs to store files or something?
I don't think that's gonna work on serveless hosting
Japanese jack mackerelOP
its connected to atlas
not sure about node tho, it should technically work. but never tried it. also woudn't recommend it
lemme remind you once again. public folder is not for file uploads storage, it's for static files.
@averydelusionalperson lemme remind you once again. public folder is not for file uploads storage, it's for static files.
Japanese jack mackerelOP
what does static files exactly mean and where should i store my images lmao
id recomend r2
but yeah so many options (even the chaos base64 in db option)
has 14 days free trial, and pricing based on usage (minimum 10 dollars credit at the beginning tho)
Japanese jack mackerelOP
i thought id be smart storing them in the public directory under the title's name title/Thumbnail.png then importing them
@Japanese jack mackerel what does static files exactly mean and where should i store my images lmao
static files = banner images, robot files, font files, etc.
Japanese jack mackerelOP
alright ill get lunch and try one of the services u recomanded ty for ur time both 🙂
noice, now don't mark my answer
Japanese jack mackerelOP
i market risky was different issue to begin with lmao
oh yeah lol
Japanese jack mackerelOP
am deleting the code snippets tho c:
I totally forgot
noice
@averydelusionalperson why?
Japanese jack mackerelOP
Paranoia probably
you do you, I personally wouldn't delete tho as it may help some future members who has same issue 🤷♂️
@averydelusionalperson you do you, I personally wouldn't delete tho as it may help some future members who has same issue 🤷♂️
Japanese jack mackerelOP
I left the necessary parts lmao
NVM, I even forgot what code snippers were there in the first place
