mirror of
https://github.com/ApfelTeeSaft/R2-Explorer.git
synced 2026-09-03 12:03:25 +00:00
* Bundle dashboard with worker assets * Show server configs in info side menu
23 lines
443 B
TypeScript
23 lines
443 B
TypeScript
import { R2Explorer } from "../src";
|
|
|
|
const baseConfig = {
|
|
readonly: false,
|
|
cors: true,
|
|
showHiddenFiles: true
|
|
};
|
|
|
|
export default {
|
|
async email(event, env, context) {
|
|
await R2Explorer(baseConfig).email(event, env, context);
|
|
},
|
|
async fetch(request, env, context) {
|
|
return R2Explorer({
|
|
...baseConfig,
|
|
basicAuth: {
|
|
username: env.BASIC_USERNAME,
|
|
password: env.BASIC_PASSWORD,
|
|
},
|
|
}).fetch(request, env, context);
|
|
},
|
|
};
|