-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(robots.txt): Disallow all on dev envs
- Loading branch information
1 parent
00e959d
commit eea721b
Showing
5 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# https://docs.astro.build/en/guides/integrations-guide/node/#runtime-environment-variables | ||
# Variables that should be loaded on runtime and not during build is added here, the value is not used for anything | ||
API_URL=placeholder | ||
SITE_URL=placeholder | ||
MATOMO_SITE_ID=placeholder | ||
MATOMO_INSTANCE_URL=placeholder |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const prerender = false; | ||
|
||
import.meta.env.SITE_URL; | ||
|
||
var prod_robots = `User-agent: * | ||
Disallow: /api/ | ||
Disallow: /admin/ | ||
Disallow: /django-admin/`; | ||
|
||
var dev_robots = `User-agent: * | ||
Disallow: /`; | ||
|
||
/** | ||
* GET Request | ||
*/ | ||
export async function GET() { | ||
if (import.meta.env.SITE_URL == "https://www.tg.no/") { | ||
return new Response(prod_robots, { | ||
status: 200, | ||
}); | ||
} | ||
return new Response(dev_robots, { | ||
status: 200, | ||
}); | ||
} |