randydev commited on
Commit
8699696
·
verified ·
1 Parent(s): 7008159

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +5 -5
index.js CHANGED
@@ -68,7 +68,7 @@ function generateAkenoKey() {
68
  app.use(async (req, res, next) => {
69
  await CheckMilWares.handle(req, res, next);
70
  });
71
- app.use("/v1/", apiLimiter);
72
  app.disable("x-powered-by");
73
  app.disable("link")
74
  app.use(cors({
@@ -100,7 +100,7 @@ app.use(AntibanRoutes);
100
 
101
  const specs = swaggerJsDoc(swaggerOptions);
102
 
103
- app.delete("/v1/delete-key", async (req, res) => {
104
  const dbClient = new Database("AkenoXJs");
105
  const collection = dbClient.collection("api_keys");
106
  const apiKey = req.query.api_key;
@@ -123,11 +123,11 @@ app.delete("/v1/delete-key", async (req, res) => {
123
  });
124
 
125
 
126
- app.get("/v1/test", authenticateApiKey, apiLimiter, async (req, res) => {
127
  res.json({ message: "access key" });
128
  })
129
 
130
- app.post("/v1/revoked-key", async (req, res) => {
131
  const dbClient = new Database("AkenoXJs");
132
  const collection = dbClient.collection("api_keys");
133
 
@@ -169,7 +169,7 @@ app.post("/v1/revoked-key", async (req, res) => {
169
  }
170
  });
171
 
172
- app.post('/v1/generate-key', async (req, res) => {
173
  const dbClient = new Database("AkenoXJs");
174
  const collection = dbClient.collection('api_keys');
175
  try {
 
68
  app.use(async (req, res, next) => {
69
  await CheckMilWares.handle(req, res, next);
70
  });
71
+ app.use("/api/v1/", apiLimiter);
72
  app.disable("x-powered-by");
73
  app.disable("link")
74
  app.use(cors({
 
100
 
101
  const specs = swaggerJsDoc(swaggerOptions);
102
 
103
+ app.delete("/api/v1/delete-key", async (req, res) => {
104
  const dbClient = new Database("AkenoXJs");
105
  const collection = dbClient.collection("api_keys");
106
  const apiKey = req.query.api_key;
 
123
  });
124
 
125
 
126
+ app.get("/api/v1/test", authenticateApiKey, apiLimiter, async (req, res) => {
127
  res.json({ message: "access key" });
128
  })
129
 
130
+ app.post("/api/v1/revoked-key", async (req, res) => {
131
  const dbClient = new Database("AkenoXJs");
132
  const collection = dbClient.collection("api_keys");
133
 
 
169
  }
170
  });
171
 
172
+ app.post('/api/v1/generate-key', async (req, res) => {
173
  const dbClient = new Database("AkenoXJs");
174
  const collection = dbClient.collection('api_keys');
175
  try {