Skip to content

refactor(vite): add config url#234

Merged
prajjwalkumar17 merged 1 commit into
mainfrom
local-setup
Apr 13, 2026
Merged

refactor(vite): add config url#234
prajjwalkumar17 merged 1 commit into
mainfrom
local-setup

Conversation

@prajjwalkumar17
Copy link
Copy Markdown
Member

No description provided.

@prajjwalkumar17 prajjwalkumar17 self-assigned this Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 15:20
@prajjwalkumar17 prajjwalkumar17 merged commit db54890 into main Apr 13, 2026
13 checks passed
@prajjwalkumar17 prajjwalkumar17 deleted the local-setup branch April 13, 2026 15:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Vite dev-server proxy route to forward /config requests to the local backend.

Changes:

  • Added a /config proxy entry targeting http://localhost:8080.
  • Added request/response/error console logging for the new proxy route (matching existing proxy routes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/vite.config.ts
Comment on lines +98 to +108
proxy.on('proxyReq', (proxyReq, req) => {
console.log(`\n[PROXY] ${new Date().toISOString()}`)
console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`)
})
proxy.on('proxyRes', (proxyRes, req) => {
console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`)
})
proxy.on('error', (err, req) => {
console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`)
console.log(`Error forwarding ${req.url}:`, err.message)
})
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new '/config' proxy logs the full request URL (including any query string) on every proxied request/response/error. If '/config' requests can include sensitive values in the URL, this can leak them to console output and also makes dev logs very noisy. Consider gating these logs behind an env flag/log level and/or redacting query strings before logging.

Copilot uses AI. Check for mistakes.
Comment thread website/vite.config.ts
Comment on lines +94 to +110
'/config': {
target: 'http://localhost:8080',
changeOrigin: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq, req) => {
console.log(`\n[PROXY] ${new Date().toISOString()}`)
console.log(`Forwarding: ${req.method} ${req.url} -> http://localhost:8080${req.url}`)
})
proxy.on('proxyRes', (proxyRes, req) => {
console.log(`[PROXY] Response: ${proxyRes.statusCode} ${proxyRes.statusMessage} for ${req.url}`)
})
proxy.on('error', (err, req) => {
console.log(`\n[PROXY ERROR] ${new Date().toISOString()}`)
console.log(`Error forwarding ${req.url}:`, err.message)
})
},
},
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds another proxy entry that duplicates the same configure handler block already repeated across multiple proxy routes in this file. As more routes get added, this duplication increases the risk of inconsistencies and makes edits harder. Consider extracting a shared helper (e.g., a function that returns the common configure implementation) and reusing it for '/config' and the existing routes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants