Files
web/apps/scandic-web/app/api/debug/route.ts
Joakim Jäderberg 8498026189 Merged in chore/refactor-hotel-trpc-routes (pull request #2891)
Chore/refactor hotel trpc routes

* chore(SW-3519): refactor trpc hotel routers

* chore(SW-3519): refactor trpc hotel routers

* refactor

* merge

* Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/refactor-hotel-trpc-routes


Approved-by: Linus Flood
2025-10-01 12:55:45 +00:00

23 lines
514 B
TypeScript

import { notFound } from "next/navigation"
import { NextResponse } from "next/server"
import { env } from "@/env/server"
import { auth } from "@/auth"
export const GET = async () => {
if (env.NODE_ENV !== "development") {
return notFound()
}
const user = await auth()
const sortedEnv = Object.keys(env)
.sort()
.reduce<Record<string, unknown>>((acc, key) => {
acc[key] = env[key as keyof typeof env]
return acc
}, {})
return NextResponse.json({ user, env: sortedEnv })
}