Skip to content

Commit c9c889f

Browse files
committed
remove index.html file creation
1 parent 3c9352b commit c9c889f

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

server/app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Fastify from "fastify";
22
import frameworksRouter from "./src/frameworks/frameworksRouter.js";
33
import cspRouter from "./src/csp/cspRouter.js";
44
import staticRouter from "./src/static/staticRouter.js";
5+
import * as ejs from "ejs";
6+
import * as fastifyView from "@fastify/view";
57

68
/**
79
* Builds the server but does not start it. Need it for testing API
@@ -11,6 +13,12 @@ import staticRouter from "./src/static/staticRouter.js";
1113
function buildServer(options = {}) {
1214
const fastify = Fastify(options);
1315

16+
fastify.register(fastifyView, {
17+
engine: {
18+
ejs: ejs,
19+
},
20+
});
21+
1422
fastify.addHook("onRequest", (request, reply, done) => {
1523
if (request.url.endsWith("index.html")) {
1624
reply.header("Cross-Origin-Embedder-Policy", "require-corp");

server/package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"license": "ISC",
1717
"dependencies": {
1818
"@fastify/static": "^6.11.2",
19+
"@fastify/view": "^8.2.0",
1920
"ejs": "^3.1.9",
2021
"fastify": "^4.23.2"
2122
},

0 commit comments

Comments
 (0)