traccar / traccar-web

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
787 stars 1.09k forks source link

Deploy the modern Traccar web application on Vercel #1198

Closed emmanuelh-dev closed 7 months ago

emmanuelh-dev commented 7 months ago

I now have the backend on a Digital Ocean droplet, accessible at https://api.gonzher.com. Currently, I'm working on uploading the frontend to https://gps.gonzher.com, which will be hosted on Vercel.

However, I encountered an error: https://gps.gonzher.com/api/server 404 (Not Found). Strangely, this error only occurs in production. When I upload the repository to Vercel in development, this error doesn't appear.

Here's a snippet from my vite.config.file:


server: {
  port: 3000,
  proxy: {
    '/api/socket': 'ws:https://api.gonzher.com/',
    '/api': 'https://api.gonzher.com/',
  },
},
build: {
  outDir: 'build',
},
tananaev commented 7 months ago

Proxy is only used for development.