新增KV数据库存储附件
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import r2Service from '../service/r2-service';
|
||||
import app from '../hono/hono';
|
||||
|
||||
app.get('/file/*', async (c) => {
|
||||
const key = c.req.path.split('/file/')[1];
|
||||
app.get('/oss/*', async (c) => {
|
||||
const key = c.req.path.split('/oss/')[1];
|
||||
const obj = await r2Service.getObj(c, key);
|
||||
return new Response(obj.body, {
|
||||
headers: {
|
||||
|
||||
@@ -21,3 +21,9 @@ app.put('/setting/setBackground', async (c) => {
|
||||
const key = await settingService.setBackground(c, await c.req.json());
|
||||
return c.json(result.ok(key));
|
||||
});
|
||||
|
||||
app.delete('/setting/deleteBackground', async (c) => {
|
||||
await settingService.deleteBackground(c);
|
||||
return c.json(result.ok());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user