Apply future test database GET endpoint.

This commit is contained in:
sigonasr2, Sig, Sigo 2021-08-06 01:49:31 +00:00
parent fc7d9752e0
commit 8a1eb8c3d5

View File

@ -192,6 +192,16 @@ const ENDPOINTDATA=[
} }
] ]
app.get("/"+databases,(req,res)=>{
db.query('select * from pg_database where datname like \'ngsplanner%\' limit 100')
.then((data)=>{
res.status(200).json(data.rows)
})
.catch((err)=>{
res.status(500).send(err.message)
})
})
function CreateDynamicEndpoints() { function CreateDynamicEndpoints() {
ENDPOINTDATA.map((endpoint)=>{ ENDPOINTDATA.map((endpoint)=>{
app.get("/"+endpoint.endpoint,(req,res)=>{ app.get("/"+endpoint.endpoint,(req,res)=>{