randydev commited on
Commit
bc6d89a
·
verified ·
1 Parent(s): 4f1f96f

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +12 -0
index.js CHANGED
@@ -132,6 +132,18 @@ app.get("/api/v1/json/all", async (req, res) => {
132
  res.json(AllJsonReques);
133
  });
134
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  app.post('/webhook', (req, res) => {
136
  console.log('Received webhook:', req.body);
137
  res.status(200).send('Webhook received');
 
132
  res.json(AllJsonReques);
133
  });
134
 
135
+ app.get('/testdb', (req, res) => {
136
+ const dbClient = new Database("AkenoXJs");
137
+ const collection = dbClient.collection("api_keys");
138
+ await collection.find({}).toArray(function (err, result) {
139
+ if (err) {
140
+ res.send(err);
141
+ } else {
142
+ res.send(JSON.stringify(result));
143
+ }
144
+ })
145
+ });
146
+
147
  app.post('/webhook', (req, res) => {
148
  console.log('Received webhook:', req.body);
149
  res.status(200).send('Webhook received');