Skip to content

Commit

Permalink
chore(SLB-478): preview noindex
Browse files Browse the repository at this point in the history
  • Loading branch information
colorfield committed Jan 30, 2025
1 parent c0741f2 commit 0b81b58
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/preview/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ if (isSessionRequired()) {
// Authentication middleware based on the configuration.
const authMiddleware = getAuthenticationMiddleware();

// Prevent indexing.
app.use((_, res, next) => {
res.setHeader('X-Robots-Tag', 'noindex, nofollow');
next();
});

app.get('/endpoint.js', (_, res) => {
res.send(
`window.GRAPHQL_ENDPOINT = "${
Expand Down

0 comments on commit 0b81b58

Please sign in to comment.