organized the dev tools dahsboard componetns and connected them tothe backend slightly. Still working on how to display combos as a tree, then the inspector should follow.
This commit is contained in:
18
src/app/api/dev/vor/cards/route.ts
Normal file
18
src/app/api/dev/vor/cards/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextResponse } from "next/server"
|
||||
import { Pool } from "pg"
|
||||
|
||||
const db = new Pool({
|
||||
connectionString: process.env.DB_STRING!
|
||||
})
|
||||
|
||||
export async function GET(){
|
||||
try{
|
||||
const result = await db.query("SELECT * FROM cards;")
|
||||
console.log("Got some combos")
|
||||
return NextResponse.json(result.rows ?? [])
|
||||
}catch(err){
|
||||
console.error("Could not GET cards:", err)
|
||||
return NextResponse.json( { message: "Serverside exception occurred " + err }, { status: 500 } )
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user