Skip to content

brenobaptista/node-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node URL Shortener

URL shortener service

Getting Started

This solution uses Docker and Docker Compose.

# Install dependencies (required for development with hot reload)
npm install

# Run the service
docker compose up

# Create a new short URL
curl -X POST -H "Content-Type: application/json" \
    -d '{"original_url": "https://github.com/brenobaptista"}' \
    http://localhost:3000/urls

# Get the original URL back
curl http://localhost:3000/{hash}

# Stop and remove containers and networks created by "up" (keep volumes and images).
docker compose down

# Stop and remove containers, networks, images and volumes created by "up".
docker compose down --rmi all -v

Database Connection

Connect to the PostgreSQL database using any SQL client (e.g., Beekeeper Studio, pgAdmin, DBeaver):

Property Value
Host localhost
Port 5432
Database url_shortener
User user
Password password

Author

brenobaptista
Breno Baptista

License

This project is licensed under the MIT License

About

URL shortener service

Topics

Resources

License

Stars

Watchers

Forks