Welcome to the Micro URL Shortener Service! This repository contains the code and resources for a simple and efficient URL shortening service. Easily convert long web addresses into short, concise URLs!
Start a MongoDB docker container:
docker run --name mongodb -p 27017:27017 -d mongo:latest
Run the application with below environment variables or update them if needed:
MONGO_DB_URI=mongodb://mongodb:27017
APP_DOMAIN_NAME=http://localhost:8080
Example of command with default values:
docker run -p 8004:8080 --name micro-url-shortener-service -e MONGO_DB_URI=mongodb://mongodb:27017 -e APP_DOMAIN_NAME=http://localhost:8080 ghcr.io/chatgut/micro-url-shortener-service:main
POST /- JSON format for POST:
{ "url": https://github.com/chatgut/micro-url-shortener-service } - Example output:
{ "short_url": "http://127.0.0.1:8080/eE" }
- JSON format for POST:
GET /{shortPath}- Example full GET:
http://localhost:8080/eE - Example output: The website of https://github.com/chatgut/micro-url-shortener-service
- Example full GET: