新增邮件发送和管理员功能
This commit is contained in:
16
mail-worker/src/api/r2-api.js
Normal file
16
mail-worker/src/api/r2-api.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import r2Service from '../service/r2-service';
|
||||
import app from '../hono/hono';
|
||||
|
||||
|
||||
app.get('/file/*', async (c) => {
|
||||
const key = c.req.path.split('/file/')[1];
|
||||
const obj = await r2Service.getObj(c, key);
|
||||
return new Response(obj.body, {
|
||||
headers: {
|
||||
'Content-Type': obj.httpMetadata?.contentType || 'application/octet-stream',
|
||||
'Content-Disposition': obj.httpMetadata?.contentDisposition || null
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user