Skip to content
/ go-short Public

URL Shortener is a simple web service that allows you to shorten long URLs into shorter and more convenient ones.

Notifications You must be signed in to change notification settings

Inxo/go-short

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

URL Shortener is a simple web service that allows you to shorten long URLs into shorter and more convenient ones.

Description

This service is written in Go programming language and uses SQLite database to store shortened URL addresses.

Installation

To install and run the service, you will need Docker installed. Follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/url-shortener.git
  2. Navigate to the project directory:

     cd url-shortener
  3. Build the Docker image:

docker build -t my-url-shortener .
  1. Run the Docker container:
docker run -p 8080:8080 -e BASE_URL=https://s.inxo.ru -v $(pwd)/database.db:/app/database.db my-url-shortener

Now your URL Shortener is up and running and accessible at https://localhost:8080.

Usage

To shorten a long URL, send a POST request to /shorten with a url parameter containing your long URL. For example:

curl -X POST -d "url=https://example.com/very/long/url" https://localhost:8080/shorten

The service will return the shortened URL in the response.

To use the shortened URL, simply navigate to it in your browser or make a GET request to it.

Additional Information

To configure the base URL, modify the BASE_URL environment variable in the Dockerfile.

Author

Author: Dima Lario

About

URL Shortener is a simple web service that allows you to shorten long URLs into shorter and more convenient ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published