A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.

just use window.location

Changed files
+3 -3
frontend
src
components
+1 -1
frontend/src/components/LinkList.tsx
···
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",
+2 -2
frontend/vite.config.ts
···
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"),