-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (25 loc) · 825 Bytes
/
vite.config.ts
File metadata and controls
27 lines (25 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
proxy: {
// For quick testing work around the need of a separate server for generating
// assemblyai realtime tokens. (It doesn't support CORS so fails in browser)
"/gettoken": {
target: "https://api.assemblyai.com/v2/realtime/token",
changeOrigin: true,
configure: (server, options) => {
console.log("configured");
server.on("proxyReq", (proxyreq, req, res, opt) => console.log);
},
rewrite: (path) => {
const finalPath = path.replace(/^\/gettoken/, "");
console.log(finalPath);
return finalPath;
},
},
},
},
});