import { router } from '@/app.ts'; import { authMinio } from '../minio/get-minio-resource.ts'; router.all('/api/s1/share/*splat', async (req, res) => { try { const url = req.url; const _url = new URL(url || '', 'http://localhost'); let objectName = _url.pathname.replace('/api/s1/share/', ''); objectName = decodeURIComponent(objectName); await authMinio(req, res, objectName); } catch (e) { console.log('get share resource error url', req.url); console.error('get share resource is error.', e.message); res.end('get share resource is error.'); } });