urlshortener

module
v0.0.0-...-ce4d8a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2019 License: MIT

README

URLShortener

Simple url shortener as a serivce with go
You can see the demo here

How use this service?

For get the short form of your url you can send a HTTP post request to hallows.ir/add:

Request
{
  "long_url": "<Your URL>"
}
Response
{
  "short_url": "<Shorted URL>"
}
Warning

This service has absoloutly no guarantee 😂🤣
Maybe we reset system sometimes 🤷‍♂️

Run on your server

  1. first clone this repository on your server.
    git clone https://github.com/SamanFekri/URLShortener.git
    
  2. change the domain name in nginx and server.
    • /nginx/nginx.conf
      server_name <your domain>;
      
    • src/server/main.go
      var baseUrl = <your domain with http>
      
  3. install docker
  4. install docker-compose
  5. go to the urlshortener directory and run this command:
    docker-compose build
    docker-compose up
    

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL