GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ui/proxy.ts at main · base/ui

Expand file tree

/

proxy.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
24 lines (20 loc) · 1001 Bytes
/

proxy.ts

Copy path

File metadata and controls

24 lines (20 loc) · 1001 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { NextRequest, NextResponse } from 'next/server';
import { disabledRoutePrefixes } from './deploy.config.mjs';
export function proxy(req: NextRequest) {
// Surfaces not shipped to this build target (deploy.config.mjs) 404 at the
// edge. This is the authoritative status block: a disabled section's page may
// be statically prerendered, so its layout notFound() serves 404 content with
// a 200 status — enforcing the real 404 here, before the static asset is
// served. Prefixes are build-time constant (target is inlined).
const { pathname } = req.nextUrl;
for (const prefix of disabledRoutePrefixes()) {
if (pathname === prefix || pathname.startsWith(`${prefix}/`)) {
return new NextResponse('Not Found', { status: 404 });
}
}
return NextResponse.next();
}
// Match everything except the public API, Next internals, and static assets.
export const config = {
matcher: ['/((?!api/|_next/static|_next/image|favicon.ico|robots.txt|sitemap.xml).*)'],
};
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.