From eb518341c83600f0710e3a5f2514ce46910825e2 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Tue, 9 Aug 2022 19:09:36 -0600 Subject: [PATCH] Add endpoint for serving site files --- src/endpoints/fileServer.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/endpoints/fileServer.ts diff --git a/src/endpoints/fileServer.ts b/src/endpoints/fileServer.ts new file mode 100644 index 0000000..babcb02 --- /dev/null +++ b/src/endpoints/fileServer.ts @@ -0,0 +1,14 @@ +import { ServerRoute } from "@hapi/hapi"; + +const route: ServerRoute = { + method: `GET`, path: `/static/{path*}`, + options: {}, + handler: { + directory: { + path: `.`, + redirectToSlash: true, + index: true, + }, + }, +}; +export default route; \ No newline at end of file