mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
14 lines
483 B
TypeScript
14 lines
483 B
TypeScript
import { json } from '@remix-run/node';
|
|
import type { LoaderFunction } from '@remix-run/node';
|
|
import { getOSSUploadPolicy, type OSSPolicy } from '~/utils/aliyunOSS.server';
|
|
|
|
export const loader: LoaderFunction = async () => {
|
|
try {
|
|
const policy: OSSPolicy = await getOSSUploadPolicy();
|
|
return json(policy);
|
|
} catch (error) {
|
|
console.error('Error generating OSS upload policy:', error);
|
|
return json({ error: '获取上传策略失败' }, { status: 500 });
|
|
}
|
|
};
|