feat: init project SelfChckout

This commit is contained in:
Luis Felipe Cadavid 2024-09-19 19:22:43 -05:00
parent 765cc0c7cf
commit 9d31ea245c
62 changed files with 8869 additions and 7149 deletions

View file

@ -1,22 +1,24 @@
import { trace } from "@opentelemetry/api"
import { NextResponse } from "next/server"
import type { NextRequest } from "next/server"
export function middleware(request: NextRequest) {
// Iniciar una nueva traza para el middleware
const tracer = trace.getTracer("nextjs-middleware")
const span = tracer.startSpan("middleware-span")
// TODO: Feel free to remove this block
if (request.headers?.get("host")?.includes("next-enterprise.vercel.app")) {
span.setAttribute("redirect", true)
span.end()
return NextResponse.redirect("https://blazity.com/open-source/nextjs-enterprise-boilerplate", { status: 301 })
}
// Finalizar la traza
span.end()
return NextResponse.next()
}
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
"/((?!api|_next/static|_next/image|favicon.ico).*)",
],
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
}