
Sanjay Sikdar
I'm having a lot of trouble with serving an apple-app-site-association file in the Next.js project.
Keep in mind that:
The solution is to place the apple-app-site-association file in your Next.js project's public folder named public/apple-app-site-association.
Then open your config file next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
async headers() {
return [
{
// Match all API routes
source: "/apple-app-site-association",
headers: [
{
key: "Content-Type",
value: "application/json",
},
],
},
];
},
}Now to check open localhost:3000/apple-app-site-association
This setup allows you to serve the apple-app-site-association file in your Next.js project.
Hope it will work for you! Let me know if you need further assistance!