feat: dynamic engine list in start page

This commit is contained in:
Artemy 2023-08-15 13:11:09 +03:00
parent 7000189d6d
commit 23a6484e20
2 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,8 @@
import { FastifyInstance } from "fastify"; import { FastifyInstance } from "fastify";
import { engineList } from "../handlers/main";
export default async function parseRoute(fastify: FastifyInstance) { export default async function parseRoute(fastify: FastifyInstance) {
fastify.get("/start", async (_, reply) => { fastify.get("/start", async (_, reply) => {
return reply.view("/templates/start.ejs"); return reply.view("/templates/start.ejs", { engineList });
}); });
} }

View File

@ -17,7 +17,12 @@
<label for="engine">Engine</label> <label for="engine">Engine</label>
<select name="engine"> <select name="engine">
<option selected value>Standard</option> <option selected value>Standard</option>
<option value="readability">Readability</option> <% engineList.forEach((engine)=>{
%>
<option value="<%= engine %>">
<%= engine %>
</option>
<% }) %>
</select> </select>
</p> </p>
<p> <p>