Giter Site home page Giter Site logo

mivinci / shorturl Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 13 KB

A simple URL shortening service.

Home Page: https://l.xjj.pub

Go 47.43% HTML 20.07% Dockerfile 2.52% JavaScript 15.99% CSS 14.00%
url-shortener shortid shorturl shorturl-services

shorturl's Introduction

shorturl

Try it out

Demo site: https://l.xjj.pub

Or you may wanna offer me a nicer and shorter domain ๐Ÿ™ƒ.

Deploy on your own host

Apparently deploying by docker is suggested, so make sure you have docker n your host before everything.

  • Clone this repo
git clone [email protected]:Mivinci/shorturl.git
cd shorturl
  • Build the docker image
docker build -t shorturl .
  • Run the image
docker run --rm -d -p 5000:8080 shorturl

Surely, you can change 5000 to any other port you'd like to deploy on for this project.

  • Use Caddy for reverse proxy (Optional)

Make sure you have installed Caddy on your host.

  1. Create a Caddyfile in the root directory of the repo and write the following content in it.
xxx.com {
    reverse_proxy localhost:5000
}

You need to change xxx.com to your own domain name.

  1. Run the following commands to activate the Caddyfile you just wrote and reload Caddy.
caddy adapt
caddy reload

Besides, Caddy will automatically generate certificate files for your site, so you can visit it by https after using Caddy.

About this repo

I didn't use go mod, also known as go module to manage this project, because I wanted to keep the root directory clean. It doesn't actually bother me not to use go mod for such a small project. Also, I'd like to regard this project as a minimal implementation for a URL shortening service, so only the most needed functionalities were coded.

shorturl's People

Contributors

mivinci avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.