Convert all src/views/*.ts template-literal modules to .ejs templates under views/. Register @fastify/view plugin in server.ts with EJS engine and _layout.ejs as the layout file. Update route handlers to use reply.view() instead of reply.send(layout(...)). Delete the old TypeScript view modules and layout.ts. Closes #19
14 lines
333 B
Plaintext
14 lines
333 B
Plaintext
<div class="form-container">
|
|
<h1>Upload a file</h1>
|
|
<% if (error) { %>
|
|
<p class="error"><%= error %></p>
|
|
<% } %>
|
|
<form method="POST" action="/upload" enctype="multipart/form-data">
|
|
<label>
|
|
File
|
|
<input type="file" name="file" required>
|
|
</label>
|
|
<button type="submit">Upload</button>
|
|
</form>
|
|
</div>
|