mparisi76
HOBBYOP
a year ago
Hello. I get the following response when I try to access my app:
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?Pinned Solution
root101
HOBBY
a year 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'
]
}
});3 Replies
a year ago
Should be in your project's root directory.
root101
HOBBY
a year 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 • 11 months ago