serve static files with nextjs

serve static files with nextjs

Next.js can serve static files, like images, under a folder called public in the root directory. Files inside public can then be referenced by your code starting from the base URL (/). This folder is also useful for robots.txt, Google Site Verification etc.

Copy Snippet
function MyImage() {
  return <img src="/my-image.png" alt="my image" />
}

export default MyImage