Giter Club home page Giter Club logo

rust-urlshortener's Introduction

URL Shortener

How to run


Ubuntu

NOTE: only tested on ubuntu 20.04 LTS, should only work on later version (inclusive)

Then run/follow commands and comments below

# install dependency
sudo apt update
sudo apt install -y make

# install docker
# https://docs.docker.com/engine/install/ubuntu/

# install docker compose if not yet
# MAKE SURE YOU USE DOCKER COMPOSE V2, OTHERWISE THINGS MIGHT BE BROKEN
# i.e. `docker compose` should work, instead of `docker-compose`
# https://docs.docker.com/compose/install/linux/

# to make sure you can run docker in non-root mode
# following command might be needed
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

# showing help message
make

# start database
# it is normal to block for a while (~30s),
# since it will wait until mysql to be ready
make database/up

# start the app
# you might get a panic
make server

# now you can run test
# run in another terminal
# make test

# run in another termianl
# example command
# port 11111 for accessing server directly
curl -X POST 'http://localhost:8000/url' -d '{"url":"https://google.com"}'  
curl -X GET -L 'http://localhost:8000/1234567'
curl -X GET 'http://localhost:8000/url'

Functional requirement


  • A URL shortener service exposing two endpoint
    • POST /url
      • Create short URL
    • GET /{url_id}
      • Access short URL
    • GET /url
      • List all URL

TODOs


  • implement bloom filter
  • add CI

rust-urlshortener's People

Contributors

b04902036 avatar

Watchers

 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.