From 8a1eb8c3d52347a978aed2fa9e7310bd438705fe Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Fri, 6 Aug 2021 01:49:31 +0000 Subject: [PATCH] Apply future test database GET endpoint. --- server.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server.js b/server.js index bd1106d..23b0a58 100644 --- a/server.js +++ b/server.js @@ -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() { ENDPOINTDATA.map((endpoint)=>{ app.get("/"+endpoint.endpoint,(req,res)=>{