-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ejs
105 lines (98 loc) · 3.23 KB
/
index.ejs
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Api Simpsons Trivia</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" />
<script src="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-standalone-preset.js"></script>
<script>
window.onload = function() {
const ui = SwaggerUIBundle({
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
layout: "BaseLayout",
spec: JSON.parse('<%- JSON.stringify(swaggerSpec) %>'),
docExpansion: 'list',
defaultModelsExpandDepth: -1,
displayRequestDuration: true,
filter: true,
syntaxHighlight: {
activate: true,
theme: "agate"
}
});
};
</script>
<style>
body {
font-family: "Helvetica Neue", Arial, sans-serif;
}
.docs-button {
padding: 10px;
background-color: rgb(64, 125, 223);
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
width: auto;
}
.account-button {
padding: 10px;
background-color: rgb(223, 64, 207);
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
width: 87%;
}
.api-docs {
margin: 20px auto;
padding: 30px;
border-radius: 10px;
background: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
max-width: 1200px;
}
.game-button {
padding: 10px;
background-color: rgb(64, 125, 223);
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
width: 87%;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1 align="center">Bienvenido a la API Trivia de los Simpsons 🍩</h1>
<div>
<% if (isDevelopment) { %>
<div style="text-align: center; margin-top: 50px;">
<button class="game-button" onclick="window.location.href='/api/v1/play'">Jugar Trivia</button>
<% if (isAuthenticated) { %>
<button class="account-button" onclick="window.location.href='/api/v1/protected'">Panel de Usuario</button>
<% } else { %>
<button class="account-button" onclick="window.location.href='/api/v1/account'">Login / Register (Pruebas)</button>
<% } %>
</div>
<% } %>
</div>
<div class="api-docs">
<div id="swagger-ui"></div>
</div>
</body>
</html>