just use window.location
This commit is contained in:
parent
18a86af62b
commit
abd01492db
2 changed files with 3 additions and 3 deletions
|
@ -82,7 +82,7 @@ export function LinkList({ refresh = 0 }: LinkListProps) {
|
|||
|
||||
const handleCopy = (shortCode: string) => {
|
||||
// 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}`)
|
||||
toast({
|
||||
description: "Link copied to clipboard",
|
||||
|
|
|
@ -5,14 +5,14 @@ import path from "path"
|
|||
|
||||
export default defineConfig(() => ({
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: {
|
||||
/*server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: process.env.VITE_API_URL || 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},*/
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue