strapi / nextjs-corporate-starter

Strapi Demo application for Corporate Websites using Next.js
MIT License
955 stars 285 forks source link

How to get images from public folder in this app #90

Closed asifdastagir-ovrlod closed 8 months ago

asifdastagir-ovrlod commented 8 months ago

How to get images form a public folder in this app??

aarajbhattarai commented 8 months ago

add the file path in middleware.tsx.

`export function middleware(request: NextRequest) { const pathname = request.nextUrl.pathname;

// // `/_next/` and `/api/` are ignored by the watcher, but we need to ignore files in `public` manually.
// // If you have one
if (
    [
        '/manifest.json',
        '/favicon.ico',
        '/robots.txt',
        '/sitemap.xml',

        // Your other files in `public`
    ].includes(pathname)
)
    return;`
PaulBratslavsky commented 8 months ago

@aarajbhattarai thank you for your awesome help with the answer I will close this issue now.