1
Fork 0
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:
diced 2025-01-17 17:05:05 -08:00
parent 33522fcdc6
commit bed8a5df03
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View 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 },
);