-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (35 loc) · 1.17 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const express = require('express');
const swaggerUi = require('swagger-ui-express');
const swaggerJsdoc = require('swagger-jsdoc');
const app = express();
const PORT = process.env.PORT || 8000;
const swaggerOptions = {
definition: {
openapi: '3.0.0',
info: {
title: 'JWT Labs',
version: '1.0.0',
description: '',
},
servers: [
{
url: 'http://localhost:8000',
},
],
},
apis: ['./controllers/*.js'],
};
const swaggerDocs = swaggerJsdoc(swaggerOptions);
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerDocs));
app.get('/', (req,res) => {
return res.redirect('/swagger');
})
app.use("/", express.static(__dirname + '/public'));
app.use('/weak-secret', require('./controllers/weak-secret'));
app.use('/none-attack', require('./controllers/none-attack'));
app.use('/kid-injection', require('./controllers/kid-injection'));
app.use('/jku-injection', require('./controllers/jku-injection'));
app.use('/algorithm-confusion', require('./controllers/algorithm-confusion'));
app.listen(PORT, () => {
console.log(`Listening on http://localhost:${PORT}/`);
});