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 4c6e0b5 commit 4dfd341Copy full SHA for 4dfd341
functions/robots.txt.ts
@@ -0,0 +1,12 @@
1
+import { StatusCodes } from 'http-status-codes';
2
+import type { RequestContext } from '../src/backend/context';
3
+import { error, response } from '../src/backend/utils';
4
+
5
+export async function onRequest({ env }: RequestContext) {
6
+ try {
7
+ return response(StatusCodes.OK, 'User-agent: *\nDisallow: /', false);
8
+ } catch (e: any) {
9
+ console.error(e);
10
+ return error(StatusCodes.INTERNAL_SERVER_ERROR, env.DEBUG && e?.message);
11
+ }
12
+}
0 commit comments