diff --git a/client/vite.config.ts b/client/vite.config.ts index 8b0f57b..9a325d4 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -3,5 +3,10 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [react()], + server: { + proxy:{ + "/api": "http://localhost:8080" + } + } }) diff --git a/server/src/index.ts b/server/src/index.ts index 181f6ec..db56741 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -9,15 +9,15 @@ import authRoutes from './routes/auth' const bootstrap = async () => { await mongo.connect() - app.get('/', (req, res) => { + app.get('/api', (req, res) => { res.status(200).send('Hello, world!') }) - app.get('/healthz', (req, res) => { + app.get('/api/healthz', (req, res) => { res.status(204).end() }) - app.use('/auth', authRoutes) + app.use('/api/auth', authRoutes) // add rest of routes here... app.listen(PORT, () => {