Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
En Sveltekit & Vite... ¿Cómo proxy/ocultar la carpeta "api"? Funciona local pero no en Vercel

Estoy usando sveltekit, cuando los clientes solicitan:

https://ejemplo.com/v1/contactos

Me gustaría estar apuntando internamente a:

https://ejemplo.com/api/v1/contactos

* De esta manera puedo tener una organización mucho mejor y más limpia en mi código.

Este es mi vite.config.js:

 import { sveltekit } from '@sveltejs/kit/vite'; /** @type {import('vite').UserConfig} */ const config = { plugins: [sveltekit()], server: { port: 3001 proxy: { '/v1': { target: 'http://127.0.0.1:3001/', secure: false, changeOrigin: true, rewrite: (path) => { return 'api/' + path; } } } }, preview: { port: 3001 } }; export default config;

Funciona en localhost, npm run dev y en localhost cuando ejecuto npm run preview, pero cuando lo subo a Vercel, no funciona. ¿Algunas ideas?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!