randydev commited on
Commit
4067ca0
·
verified ·
1 Parent(s): bd012e1

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +6 -1
index.js CHANGED
@@ -26,7 +26,7 @@ import * as cheerio from 'cheerio';
26
  import * as lifestyle from './startup/lifestyle.js';
27
 
28
  import { Readable } from "stream";
29
- import { CheckMilWare } from './middleware/midware.js';
30
  import { setup, serve } from './swagger.js';
31
  import { swaggerOptions } from './settingOptions.js';
32
  import path from "path";
@@ -66,6 +66,11 @@ app.use(
66
 
67
  app.use(express.static('public'));
68
 
 
 
 
 
 
69
  app.get("/policy", ( req, res ) => {
70
  res.sendFile(path.join(__dirname + "/public/policy.html"));
71
  });
 
26
  import * as lifestyle from './startup/lifestyle.js';
27
 
28
  import { Readable } from "stream";
29
+ import { CheckMilWare, authenticateApiKey, apiLimiter} from './middleware/midware.js';
30
  import { setup, serve } from './swagger.js';
31
  import { swaggerOptions } from './settingOptions.js';
32
  import path from "path";
 
66
 
67
  app.use(express.static('public'));
68
 
69
+
70
+ app.get('/protected', authenticateApiKey, apiLimiter, (req, res) => {
71
+ res.json({ message: 'Authorized access!' });
72
+ });
73
+
74
  app.get("/policy", ( req, res ) => {
75
  res.sendFile(path.join(__dirname + "/public/policy.html"));
76
  });