fix(server): configuration page
This commit is contained in:
parent
d477de027a
commit
8be52a0237
@ -1,8 +1,8 @@
|
|||||||
import { Middleware, JSX } from '@txtdot/sdk';
|
import { Middleware, JSX } from '@txtdot/sdk';
|
||||||
|
|
||||||
const Highlight = new Middleware(
|
const Highlight = new Middleware(
|
||||||
'highlight',
|
'Highlight',
|
||||||
'Highlights code with highlight.js',
|
'Highlights code with highlight.js only when needed',
|
||||||
['*']
|
['*']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ export default async function configurationRoute(fastify: FastifyInstance) {
|
|||||||
fastify.get('/configuration', { schema: indexSchema }, async (_, reply) => {
|
fastify.get('/configuration', { schema: indexSchema }, async (_, reply) => {
|
||||||
return reply.view('/templates/configuration.ejs', {
|
return reply.view('/templates/configuration.ejs', {
|
||||||
engines: distributor.engines_fallback,
|
engines: distributor.engines_fallback,
|
||||||
|
middlewares: distributor.middles_fallback,
|
||||||
config,
|
config,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -42,6 +42,14 @@
|
|||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
</ol>
|
</ol>
|
||||||
|
<h2>Available middlewares</h2>
|
||||||
|
<ol>
|
||||||
|
<%
|
||||||
|
for (const middleware of middlewares) {
|
||||||
|
%><li><%= middleware.name %>: <%= middleware.description %></li><%
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
</ol>
|
||||||
<h2>Available routes</h2>
|
<h2>Available routes</h2>
|
||||||
<%
|
<%
|
||||||
for (const route of config.dyn.routes) {
|
for (const route of config.dyn.routes) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user