diff --git a/frontend.js b/frontend.js new file mode 100644 index 0000000..05bee7a --- /dev/null +++ b/frontend.js @@ -0,0 +1,8 @@ +export class Frontend { + async serve(event) { + // TODO: load files from different mounted repos + event.respondWith(new Response( + 'Not Found', {status: 404} + )) + } +} \ No newline at end of file diff --git a/server.js b/server.js index 6cb3027..7debcfe 100644 --- a/server.js +++ b/server.js @@ -1,8 +1,10 @@ -import { Auth } from './auth' +import { Auth } from "./auth" +import { Frontend } from "./frontend" export class Server { constructor() { this.auth = new Auth() + this.frontend = new Frontend() } async getEnv(variables) { @@ -35,9 +37,7 @@ export class Server { if (pathname === `${this.baseUrl}/api/auth`) { await this.auth.redirect(event) } else { - event.respondWith(new Response( - 'Not Found', {status: 404} - )) + await this.frontend.serve(event) } }