We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06f7ef8 commit e4bf078Copy full SHA for e4bf078
test/fixtures/hook-config/server/plugins/robots.ts
@@ -0,0 +1,21 @@
1
+import { defineNitroPlugin } from '#imports'
2
+
3
+export default defineNitroPlugin((nitroApp) => {
4
+ // Replicate the user's code from issue #233
5
+ nitroApp.hooks.hook('robots:config', async (ctx) => {
6
+ // Add groups via the hook - these will NOT be normalized
7
+ ctx.groups.push({
8
+ userAgent: ['*'],
9
+ comment: ['Block all from operational endpoints'],
10
+ allow: [],
11
+ disallow: ['/_cwa/*'],
12
+ })
13
14
15
+ userAgent: ['AhrefsBot'],
16
+ comment: ['Block AI crawlers'],
17
18
+ disallow: ['/'],
19
20
21
+})
0 commit comments