Skip to content

Commit 3b5bd2f

Browse files
committed
Test config CORS
1 parent b76c7f9 commit 3b5bd2f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/routes/api/rpc.$.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { createFileRoute } from '@tanstack/react-router';
55
import { router } from '@/server/router';
66

77
const handler = new RPCHandler(router, {
8-
plugins: [new CORSPlugin(), new ResponseHeadersPlugin()],
8+
plugins: [
9+
new CORSPlugin({
10+
origin: (origin) => origin,
11+
}),
12+
new ResponseHeadersPlugin(),
13+
],
914
});
1015

1116
async function handle({ request }: { request: Request }) {

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export default defineConfig(({ mode }) => {
1818
return {
1919
server: {
2020
cors: {
21-
origin: /https?:\/\/([A-Za-z0-9\-.]+)?\.clever-cloud\.com$/,
21+
origin:
22+
'https://app_f2f72550-f286-4843-9a51-57222a943e02.cleverapps.io',
2223
},
2324
port: env.VITE_PORT ? Number(env.VITE_PORT) : 3000,
2425
strictPort: true,

0 commit comments

Comments
 (0)