Skip to content

Commit e4bf078

Browse files
committed
chore: broken test
1 parent 06f7ef8 commit e4bf078

File tree

1 file changed

+21
-0
lines changed
  • test/fixtures/hook-config/server/plugins

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
ctx.groups.push({
15+
userAgent: ['AhrefsBot'],
16+
comment: ['Block AI crawlers'],
17+
allow: [],
18+
disallow: ['/'],
19+
})
20+
})
21+
})

0 commit comments

Comments
 (0)