mirror of
https://github.com/diced/zipline.git
synced 2025-04-11 23:31:17 -05:00
feat: implement /robots.txt
This commit is contained in:
parent
33522fcdc6
commit
bed8a5df03
1 changed files with 16 additions and 0 deletions
16
src/server/routes/robots.txt.ts
Normal file
16
src/server/routes/robots.txt.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { config } from '@/lib/config';
|
||||
import fastifyPlugin from 'fastify-plugin';
|
||||
|
||||
export const PATH = '/robots.txt';
|
||||
export default fastifyPlugin(
|
||||
(server, _, done) => {
|
||||
server.get(PATH, async (_, res) => {
|
||||
if (!config.features.robotsTxt) return res.notFound();
|
||||
|
||||
return 'User-Agent: *\nDisallow: /';
|
||||
});
|
||||
|
||||
done();
|
||||
},
|
||||
{ name: PATH },
|
||||
);
|
Loading…
Add table
Reference in a new issue