16 lines
392 B
TypeScript
16 lines
392 B
TypeScript
|
|
import { MetadataRoute } from 'next';
|
||
|
|
import { getBaseUrl } from '../lib/sitemap-utils';
|
||
|
|
|
||
|
|
export default function robots(): MetadataRoute.Robots {
|
||
|
|
const baseUrl = getBaseUrl();
|
||
|
|
|
||
|
|
return {
|
||
|
|
rules: {
|
||
|
|
userAgent: '*',
|
||
|
|
allow: '/',
|
||
|
|
disallow: ['/api/', '/_next/', '/admin/', '*.json'],
|
||
|
|
},
|
||
|
|
sitemap: `${baseUrl}/sitemap.xml`,
|
||
|
|
};
|
||
|
|
}
|