Add endpoint for serving site files
This commit is contained in:
parent
29eb4cc933
commit
eb518341c8
1 changed files with 14 additions and 0 deletions
14
src/endpoints/fileServer.ts
Normal file
14
src/endpoints/fileServer.ts
Normal file
|
|
@ -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;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue