nitro
nitro copied to clipboard
Error proxying Drizzle Studio
Environment
bun: 1.2.19 nitropack: latest drizzle-orm: ^0.44.2 drizzle-kit: ^0.31.1
Reproduction
Steps:
- Run Drizzle Studio
- Proxy like this:
routeRules: {
"/studio/**": {
proxy: { to: "https://local.drizzle.studio/**"},
},
}
Describe the bug
I am trying to proxy drizzle studio, like this:
routeRules: {
"/studio/**": {
proxy: { to: "https://local.drizzle.studio/**"},
},
}
Now this is not working. As drizzle-studio makes a call for /index.js. So instead of returning the index.js file from drizzle-studio, it is returning 404.
this call was being made: http://localhost:4000/index.js
Instead it should be a proxied call to https://local.drizzle.studio/index.js
Additional context
I found a solution for this:
routeRules: {
"/proxy/studio/**": {
proxy: { to: "https://local.drizzle.studio/**"},
},
"/proxy/index.js": {
proxy: { to: "https://local.drizzle.studio/index.js"},
},
}
but this is not ideal
Logs
Even though I think this is drizzle issue. I thought it was worth mentioning here as well.