update
A high-performance short URL service built with Go, Gin, and gokv2.
shorturl/ ├── main.go # Entry point ├── go.mod # Go module ├── go.sum # Go dependencies ├── internal/ │ ├── handler/ # HTTP handlers │ │ └── handler.go │ └── store/ # Data layer │ └── store.go # L1 Cache, Bloom Filter, Async Writer └── frontend/ # Frontend app ├── app/ │ ├── layout.tsx │ └── page.tsx ├── vite.config.ts ├── package.json └── tsconfig.json
cd shorturl go mod tidy go run main.go
The server will start on http://localhost:8080
cd shorturl/frontend pnpm install pnpm dev
The frontend will start on http://localhost:5173
curl -X POST http://localhost:8080/api/shorten \ -H "Content-Type: application/json" \ -d '{"original": "https://example.com/very/long/url", "expire_days": 30}'
Access http://localhost:8080/{code} to be redirected to the original URL.
http://localhost:8080/{code}
MIT
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Short URL Service
A high-performance short URL service built with Go, Gin, and gokv2.
Features
Tech Stack
Backend
Frontend
Project Structure
Getting Started
Prerequisites
Backend
The server will start on http://localhost:8080
Frontend
The frontend will start on http://localhost:5173
API Endpoints
Create Short URL
Redirect
Access
http://localhost:8080/{code}to be redirected to the original URL.Performance Optimization
Read Path
Write Path
Bloom Filter
Async Writer
License
MIT