add frontend class for serving frontend files from repos

shared-server
bat 3 years ago
parent dcaf72e700
commit b43f35d1b9

@ -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}
))
}
}

@ -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)
}
}

Loading…
Cancel
Save