Skip to content

This repository contains a url shortener built using hexagonal architecture

Notifications You must be signed in to change notification settings

jwambugu/hexagonal-architecture-url-shortner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

This is a URL shortener built using Go. The main objective was to learn how to use the Hexagonal Architecture. The service currently supports the following databases

Run Locally

Clone the project

  git clone git@github.com:jwambugu/hexagonal-architecture-url-shortner.git

Go to the project directory

  cd hexagonal-architecture-url-shortner

Set the environment variables (Redis)

  export MS_REPOSITORY=redis
  export REDIS_URL=redis-url-goes-here

Set the environment variables (MongoDB)

  export MS_REPOSITORY=mongo
  export MONGO_URL=mongo-url-goes-here
  export MONGO_DB=redirects

Start the server

  go run main.go

API Reference

Get Shortened URL

  GET /{code}
Parameter Type Description
code string Required.

Shorten URL

  POST /
Parameter Type Description
url string Required. URL to shorten

References

About

This repository contains a url shortener built using hexagonal architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages