diff --git a/app/package.json b/app/package.json index 66721a1..33f1bbf 100644 --- a/app/package.json +++ b/app/package.json @@ -69,7 +69,6 @@ "@types/uuid": "^9.0.1", "@vitejs/plugin-react": "^4.0.2", "babel-plugin-formatjs": "^10.5.3", - "http-proxy-middleware": "^2.0.6", "typescript": "^4.9.5", "vite": "^4.4.1", "vite-plugin-comlink": "^3.0.5" diff --git a/app/src/setupProxy.js b/app/src/setupProxy.js deleted file mode 100644 index 06b4038..0000000 --- a/app/src/setupProxy.js +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable no-undef */ -const { createProxyMiddleware } = require('http-proxy-middleware'); - -module.exports = function (app) { - app.use( - '/chatapi', - createProxyMiddleware({ - target: 'http://localhost:3001', - secure: false, - changeOrigin: true, - }) - ); -}; \ No newline at end of file diff --git a/app/vite.config.js b/app/vite.config.js index 5bcc743..e8aefa1 100644 --- a/app/vite.config.js +++ b/app/vite.config.js @@ -4,6 +4,15 @@ import { comlink } from "vite-plugin-comlink"; export default defineConfig(() => { return { + server: { + proxy: { + "/chatapi": { + target: "http://localhost:3001", + secure: false, + changeOrigin: true, + }, + }, + }, build: { outDir: "build", },