Update index.js
Browse files
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 |
});
|