Replaced Vite proxy with SvelteKit API route
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
export async function GET({ params, url }) {
|
||||||
|
const res = await fetch(`http://37100lab.it:8101/api/${params.path}${url.search}`);
|
||||||
|
return new Response(res.body, {
|
||||||
|
status: res.status,
|
||||||
|
headers: {
|
||||||
|
'content-type': res.headers.get('content-type') ?? 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -3,9 +3,4 @@ import { defineConfig } from 'vite';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {
|
|
||||||
proxy: {
|
|
||||||
'/api': 'http://37100lab.it:8101',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user