Restore seed-wikipedia.js and seed-catalog-data.js so npm run setup works on a fresh clone. Point nginx at the Vite dev client and allow the public hostname in Vite config.
22 lines
545 B
TypeScript
22 lines
545 B
TypeScript
import path from 'node:path'
|
|
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, path.resolve(__dirname, '..'), '')
|
|
const apiTarget = `http://localhost:${env.PORT || '3001'}`
|
|
|
|
return {
|
|
plugins: [react()],
|
|
server: {
|
|
host: true,
|
|
allowedHosts: ['gallery.mysuperlab.netcraze.pro', 'localhost'],
|
|
proxy: {
|
|
'/api': apiTarget,
|
|
'/images': apiTarget,
|
|
},
|
|
},
|
|
}
|
|
})
|