GithubHelp home page GithubHelp logo

urlshortner's Introduction

URLShortner

How to run: -- Use visual studio with asp.net core 5.0 installed or -- Use command

docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d

Goto http://localhost:5000/swagger/index.html

-- Try on Post with version "1" and below payload for different scenarios:

  • Default short url generate

    { "originalURL": "https://www.google.com/", "useCustomKey": false, "customUniqueKey": "string", "useCustomExpiry": false, "expiryTimeInSeconds": 0 }

  • Generate with custom key

    { "originalURL": "https://www.google.com/", "useCustomKey": true, "customUniqueKey": "googl", "useCustomExpiry": false, "expiryTimeInSeconds": 0 }

  • Generate with custom expiry time in seconds

    { "originalURL": "https://www.google.com/", "useCustomKey": false, "customUniqueKey": "string", "useCustomExpiry": true, "expiryTimeInSeconds": 999999 }

Response:

{
  "id": "61507b319f13c8c5d516bab3",
  "originalURL": "https://www.google.com/",
  "uniqueKey": "riHZgk",
  "expiryDate": "2021-10-08T03:39:28.7489403Z",
  "redirectURL": "http://localhost:5000/riHZgk"
}

-- Go to redirectURL in browser to get redirected to original url.

-- To get redirect count goto get method: and enter version as "1" and uniqueKey as given in previous response or second part of redirect url.

Tools used: -- Redis for cache, -- Mongo for persistence, -- RabbitMQ for events(Save redirect log for more faster response)

urlshortner's People

Contributors

sandeshkarki55 avatar sandesh-interserv 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.