✂ URL shortener
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
db
handle
url
.gitignore
.travis.yml
Gopkg.lock
Gopkg.toml
README.md
main.go

README.md

Shrink Build Status

Useful commands

  • PSQL —
    CREATE DATABASE shrink;
    CREATE TABLE urls (
        id serial primary key,
        slug text unique not null,
        url text not null,
        created_at timestamp default current_timestamp(2),
        last_accessed timestamp,
        access_count integer default 0
    );
  • Run tests — ENV=test BASEURL=https://testing.com go test ./...
  • Start app — go run main.go (default host is http://localhost:8080)
  • Shrink! — curl -X POST -F url=http://www.reallylongaddress.com http://localhost:8080/create