initial commit

This commit is contained in:
2026-05-20 12:05:11 +05:30
commit f4dc2b6a5a
21 changed files with 4822 additions and 0 deletions

33
vite.config.js Normal file
View File

@@ -0,0 +1,33 @@
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
// Dev mode: proxy /api/* to api.workolik.com and inject x-hasura-admin-secret
// server-side so the secret never reaches the browser.
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const secret = (env.HASURA_ADMIN_SECRET || '').trim()
if (!secret) {
console.warn('[xpress-docs] HASURA_ADMIN_SECRET is not set in .env.local; proxied requests will hit the API without auth.')
}
return {
plugins: [react()],
server: {
port: 5173,
open: true,
proxy: {
'/api': {
target: 'https://api.workolik.com',
changeOrigin: true,
secure: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
if (secret) proxyReq.setHeader('x-hasura-admin-secret', secret)
})
}
}
}
}
}
})