Skip to content

sainathmanda7/basic_urlshortner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📌 URL Shortener Backend (Go)

A simple url_shortener project build alone with Backend. The above project fails for industrial productions, it's just a attempt to test my Backend Skills. It Correctly gives Short URL on Local Server.

🚀 Features

✔️ Shorten long URLs ✔️ Redirect short URLs to original URLs ✔️ REST API endpoints ✔️ Minimal, clean Go backend architecture ✔️ Easy to deploy (Render, Railway, etc.) ✔️ Fast and lightweight — powered by Go

🛠️ Tech Stack

Golang net/http mux

📂 Project Structure . ├── go.mod # Go module file (module name, dependencies) └── main.go # Main application file containing: # - URL shortening endpoint (/shorten) # - Random key generator # - In-memory URL store # - Redirect handler for short URLs

📡 API Endpoints ▶️ Shorten URL

POST /shorten

Body:

{ "url": "https://example.com" }

Response:

{ "short_url": "http://localhost:8080/abc123" }

🔁 Redirect to Original URL

GET /{shortCode}

Redirects the user to the original full-length URL.

📦 Installation & Run 1️⃣ Clone the repository git clone https://github.com/sainathmanda7/basic_urlshortner.git

2️⃣ Install dependencies go mod tidy

3️⃣ Run the server go run main.go

Server will run on:

http://localhost:4040

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages