url-shortener

command module
v0.0.0-...-2e5c2e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

README

URL Shortener

This repository contains the code for a URL shortener that I'm developing as part of my live-streams on YouTube. As of now this project is far from complete, but at some point it will be "production-ready".

Database

We use Postgres as a database, to start it for local devlopment using Docker, run:

docker run --name url-shortener-postgres -it -e POSTGRES_HOST_AUTH_METHOD=trust  -e POSTGRES_DB=url -e POSTGRES_USER=db_user -p 5432:5432  postgres:alpine

To connect to the database using docker and psql, run:

docker exec -it url-shortener-postgres psql -U db_user url

To create the tables use the following SQL statement:

CREATE TABLE urls (
       id SERIAL PRIMARY KEY,
       token varchar(50) UNIQUE NOT NULL,
       url varchar(2048) UNIQUE NOT NULL
);

LICENCE

GPLv3

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL