just use window.location

This commit is contained in:
Wavering Ana 2025-01-31 19:14:57 -05:00
parent 18a86af62b
commit abd01492db
2 changed files with 3 additions and 3 deletions

View file

@ -82,7 +82,7 @@ export function LinkList({ refresh = 0 }: LinkListProps) {
const handleCopy = (shortCode: string) => { const handleCopy = (shortCode: string) => {
// Use import.meta.env.VITE_BASE_URL or fall back to window.location.origin // Use import.meta.env.VITE_BASE_URL or fall back to window.location.origin
const baseUrl = import.meta.env.VITE_API_URL || window.location.origin const baseUrl = window.location.origin
navigator.clipboard.writeText(`${baseUrl}/${shortCode}`) navigator.clipboard.writeText(`${baseUrl}/${shortCode}`)
toast({ toast({
description: "Link copied to clipboard", description: "Link copied to clipboard",

View file

@ -5,14 +5,14 @@ import path from "path"
export default defineConfig(() => ({ export default defineConfig(() => ({
plugins: [react(), tailwindcss()], plugins: [react(), tailwindcss()],
server: { /*server: {
proxy: { proxy: {
'/api': { '/api': {
target: process.env.VITE_API_URL || 'http://localhost:8080', target: process.env.VITE_API_URL || 'http://localhost:8080',
changeOrigin: true, changeOrigin: true,
}, },
}, },
}, },*/
resolve: { resolve: {
alias: { alias: {
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),