rsnext/test/e2e/app-dir/metadata-dynamic-routes/app/robots.ts
Jiachi Liu 35cf930572
Update MetadataRoute to namespace (#47674)
### What?

Followup for #47630 , use ts namespace to group MetadataRoute.

`MetadataRoute['xxx']` -> `MetadataRoute.xxx`

### Why?

namespace is convenient to write for these grouped types such as
`MetadataRoute.Robots`. And `MetadataRoute` itself is not actually a
type. So it can be conveniently typed by ts users.

### How?

Closes NEXT-912

---------
2023-03-30 15:27:44 -07:00

19 lines
398 B
TypeScript

import type { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: 'Googlebot',
allow: ['/'],
},
{
userAgent: ['Applebot', 'Bingbot'],
disallow: ['/'],
crawlDelay: 2,
},
],
sitemap: 'https://example.com/sitemap.xml',
host: 'https://example.com',
}
}