|
|
|
@ -43,11 +43,6 @@ export class Server { |
|
|
|
apiBaseUrl: this.giteaApiBaseUrl, |
|
|
|
}) |
|
|
|
const promises = [] |
|
|
|
promises.push(server.frontend.loadRepo( |
|
|
|
'macchiato', |
|
|
|
'pages', |
|
|
|
{srcPath: [], destPath: []} |
|
|
|
)) |
|
|
|
const repos = [ |
|
|
|
'loader', |
|
|
|
'editor', |
|
|
|
@ -65,7 +60,37 @@ export class Server { |
|
|
|
{srcPath: [], destPath: [repo]} |
|
|
|
)) |
|
|
|
} |
|
|
|
promises.push(server.frontend.loadRepo( |
|
|
|
'macchiato', |
|
|
|
'pages', |
|
|
|
{srcPath: [], destPath: []} |
|
|
|
)) |
|
|
|
promises.push(server.frontend.loadRepo( |
|
|
|
'macchiato', |
|
|
|
'server', |
|
|
|
{ |
|
|
|
srcPath: [], |
|
|
|
destPath: ['server'], |
|
|
|
ref: 'shared-server' |
|
|
|
} |
|
|
|
)) |
|
|
|
await Promise.all(promises) |
|
|
|
this.frontend.files['/app.js'] = ( |
|
|
|
this.frontend.files['/server/app.js'] |
|
|
|
) |
|
|
|
this.frontend.files['/'] = ( |
|
|
|
this.frontend.files['/index.html'] |
|
|
|
) |
|
|
|
const sw = this.frontend.files['/sw.js'] |
|
|
|
const commit = ( |
|
|
|
this.frontend.files['/server/app.js'].commit |
|
|
|
) |
|
|
|
sw.body = ( |
|
|
|
new TextEncoder().encode( |
|
|
|
new TextDecoder().decode(sw.body) + |
|
|
|
`\n// ${commit}\n` |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
async serveRequest(event) { |
|
|
|
|