Skip to content

server.allowedHosts how to edit? #140

@better319

Description

@better319

Blocked request. This host ("xxxxx.app.cloudstudio.work") is not allowed.
To allow this host, add "xxxx.app.cloudstudio.work" to server.allowedHosts in vite.config.js.

Image

`

import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig(({ command, mode }) => {
// Load env file based on mode in the current working directory.
const env = loadEnv(mode, process.cwd(), '')

return {
plugins: [react()],
server: {
port: parseInt(env.VITE_PORT) || 5173,
proxy: {
'/api': http://localhost:${env.PORT || 3001},
'/ws': {
target: ws://localhost:${env.PORT || 3001},
ws: true
},
'/shell': {
target: ws://localhost:${env.PORT || 3002},
ws: true
}
}
},
build: {
outDir: 'dist'
}
}
})

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions