Use app based route
This commit is contained in:
parent
9afdecb76c
commit
049afb6eba
2 changed files with 13 additions and 10 deletions
13
ui/app/api/env/route.ts
vendored
Normal file
13
ui/app/api/env/route.ts
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
import process from 'process';
|
||||||
|
|
||||||
|
export async function GET(request: NextRequest) {
|
||||||
|
// Access environment variables
|
||||||
|
const envVars = {
|
||||||
|
BACKEND_API_URL: process.env.BACKEND_API_URL,
|
||||||
|
BACKEND_WS_URL: process.env.BACKEND_WS_URL
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the environment variables as a JSON response
|
||||||
|
return NextResponse.json(envVars);
|
||||||
|
}
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
|
|
||||||
import process from 'process';
|
|
||||||
|
|
||||||
export default function handler(req, res) {
|
|
||||||
const envVars = {
|
|
||||||
BACKEND_API_URL: process.env.BACKEND_API_URL,
|
|
||||||
BACKEND_WS_URL: process.env.BACKEND_WS_URL
|
|
||||||
}
|
|
||||||
res.status(200).json(envVars);
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue