Copilot/setup sentry nextjs (#58)
* Revise portfolio: warm brown theme, elegant typography, optimized analytics tracking (#55) * Initial plan * Update color theme to warm brown and off-white, add elegant fonts, fix analytics tracking Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Fix 404 page integration with warm theme, update admin console colors, fix font loading Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Address code review feedback: fix navigation, add utils, improve tracking Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Fix accessibility and memory leak issues from code review Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * chore: Code cleanup, add Sentry.io monitoring, and documentation (#56) * Initial plan * Remove unused code and clean up console statements Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Remove unused components and fix type issues Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Wrap console.warn in development check Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Integrate Sentry.io monitoring and add text editing documentation Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * Initial plan * feat: Add Sentry configuration files and example pages - Add sentry.server.config.ts and sentry.edge.config.ts - Update instrumentation.ts with onRequestError export - Update instrumentation-client.ts with onRouterTransitionStart export - Update global-error.tsx to capture exceptions with Sentry - Create Sentry example page at app/sentry-example-page/page.tsx - Create Sentry example API route at app/api/sentry-example-api/route.ts Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * feat: Update middleware to allow Sentry example page and fix deprecated API - Update middleware to exclude /sentry-example-page from locale routing - Remove deprecated startTransaction API from Sentry example page - Use consistent DSN configuration with fallback values Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> * refactor: Improve Sentry configuration with environment-based sampling - Add comments explaining DSN fallback values - Use environment-based tracesSampleRate (10% in production, 100% in dev) - Address code review feedback for production-safe configuration Co-authored-by: denshooter <44590296+denshooter@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -42,7 +42,9 @@ export function middleware(request: NextRequest) {
|
||||
pathname.startsWith("/api/") ||
|
||||
pathname === "/api" ||
|
||||
pathname.startsWith("/manage") ||
|
||||
pathname.startsWith("/editor");
|
||||
pathname.startsWith("/editor") ||
|
||||
pathname === "/sentry-example-page" ||
|
||||
pathname.startsWith("/sentry-example-page/");
|
||||
|
||||
// Locale routing for public site pages
|
||||
const responseUrl = request.nextUrl.clone();
|
||||
@@ -55,7 +57,6 @@ export function middleware(request: NextRequest) {
|
||||
res.cookies.set("NEXT_LOCALE", locale, { path: "/" });
|
||||
|
||||
// Continue below to add security headers
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
return addHeaders(request, res);
|
||||
}
|
||||
|
||||
@@ -66,7 +67,6 @@ export function middleware(request: NextRequest) {
|
||||
responseUrl.pathname = redirectTarget;
|
||||
const res = NextResponse.redirect(responseUrl);
|
||||
res.cookies.set("NEXT_LOCALE", preferred, { path: "/" });
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
return addHeaders(request, res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user