mparisi76
HOBBY
a month ago
Hello. I get the following response when I try to access my app:Blocked request. This host ("railway-backend-production.up.railway.app") is not allowed. To allow this host, add "railway-backend-production.up.railway.app" to `server.allowedHosts` in vite.config.js.
Where does this vite.config.js live and how to I access/edit this file?
1 Replies
loudbookPROTop 10% Contributor
a month ago
Should be in your project's root directory.
root101
HOBBY
a month ago
That looks like a cors config is missing.
You need to have something like this:
// vite.config.js
export default defineConfig({
//more configs
server: {
allowedHosts: [
'railway-backend-production.up.railway.app'
]
}
});
Status changed to Solved chandrika • 24 days ago