Is there a way to change the url image is served at?
Answered
Blanc de Hotot posted this in #help-forum
Blanc de HototOP
Right now the url of the image is
is there a way i can serve images at a static route link
http://localhost:3000/_next/static/media/<img_file_name>.<token>.<extension>
is there a way i can serve images at a static route link
http://localhost:3000/<img_file_name>.<extension>
10 Replies
if you are using
next/image
then no because next image performs certain optimization, if you the results you expect, put the images in public
folder and access them at /
Blanc de HototOP
this code just gives not found error for the path... in this case
http://localhost:3000/assignment.png
remove
.next
folder and restartBlanc de HototOP
same thing still
should there be something different in my
.next
folder?.next
folder is made by nextjs itselfI've never even looked into it
move the
public
folder outside src
Answer
in your project's root
Blanc de HototOP
thank you so much for your help that was the problem