Everything broke, trying to fix
This commit is contained in:
parent
69d98c69b5
commit
e1caa9b0ad
6 changed files with 115 additions and 16 deletions
17
app/api/system/shutdown/route.ts
Normal file
17
app/api/system/shutdown/route.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const token = req.cookies.get("token")?.value;
|
||||
if (!token) {
|
||||
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
|
||||
const res = await fetch("http://localhost:3001/system/shutdown", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json(await res.json(), { status: res.status });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue