txtdot/packages/server/templates/configuration.ejs

63 lines
1.8 KiB
Plaintext
Raw Normal View History

2024-03-07 14:49:54 +03:00
<%
// hide private properties from config
const to_hide = ["host", "port"];
function replacer(key,value) {
if (to_hide.includes(key)) return undefined;
else return value;
}
function to_pretty(obj) {
return JSON.stringify(obj, replacer, 2).replace(/[\[\]{}"]/g, "").replace(/,/g, "");
}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="<%= config.package.description %>">
2024-03-07 14:49:54 +03:00
<title>txt. configuration</title>
<link rel="stylesheet" href="/static/common.css">
<link rel="stylesheet" href="/static/configuration.css">
</head>
<body>
<main>
<header>
<h1>txt<span class="dot">.</span></h1>
<div class="menu">
<a class="button secondary" href="/">Home</a>
</div>
<p><%= config.package.description %></p>
2024-03-07 14:49:54 +03:00
</header>
<div class="configuration">
<h2>Configuration</h2>
<pre> version: <%= config.package.version %><%= to_pretty(config.env) %></pre>
2024-03-07 14:49:54 +03:00
<h2>Available engines</h2>
<ol>
<%
for (const engine of engines) {
%><li><%= engine.name %>: <%= engine.description %></li><%
}
%>
</ol>
2024-05-15 16:12:48 +03:00
<h2>Available middlewares</h2>
<ol>
<%
for (const middleware of middlewares) {
%><li><%= middleware.name %>: <%= middleware.description %></li><%
}
%>
</ol>
2024-03-07 14:49:54 +03:00
<h2>Available routes</h2>
<%
for (const route of config.dyn.routes) {
2024-03-07 14:49:54 +03:00
%><a class="button secondary" href="<%= route %>"><%= route %></a><%
}
%>
</div>
</main>
</body>
</html>