- DEVMODE removed; FASTAPI_VUE=MEDIAHIVE is set at entrypoints and fastapi_vue.env drives dev-mode checks - CLI roots now reach the server via fastapi-vue's env(Config) teleport (mediahive.config.config) instead of MEDIAHIVE_ROOTS - Legacy media_folder config field and migration removed - mediahive.* logger level set via log_config (DEBUG in dev, INFO in prod) in both server.run() and winmain's patched uvicorn config
39 lines
974 B
JavaScript
39 lines
974 B
JavaScript
/**
|
|
* FastAPI-Vue Vite Plugin
|
|
* auto-upgrade@fastapi-vue-setup -- remove this if you edit the plugin
|
|
*
|
|
* Configures Vite for FastAPI backend integration:
|
|
* - Proxies /api/* requests to the FastAPI backend
|
|
* - Builds to the Python module's frontend-build directory
|
|
* - Disables Vite's screen clearing on startup
|
|
*
|
|
* Options:
|
|
* paths - Array of paths to proxy (default: ['/api'])
|
|
*/
|
|
|
|
export default function fastapiVue({ paths = ['/api'] } = {}) {
|
|
const backendUrl = process.env.MEDIAHIVE_BACKEND_URL || 'http://localhost:8421'
|
|
|
|
// Build proxy configuration for each path
|
|
const proxy = {}
|
|
for (const path of paths) {
|
|
proxy[path] = {
|
|
target: backendUrl,
|
|
changeOrigin: false,
|
|
ws: true,
|
|
}
|
|
}
|
|
|
|
return {
|
|
name: 'vite-plugin-fastapi-mediahive',
|
|
config: () => ({
|
|
clearScreen: false,
|
|
server: { proxy },
|
|
build: {
|
|
outDir: '../mediahive/frontend-build',
|
|
emptyOutDir: true,
|
|
},
|
|
}),
|
|
}
|
|
}
|