Sign inSign up

serverwentdown/short

By serverwentdown

•Updated almost 7 years ago

A tiny, two-dependency, unauthenticated URL shortener service.

Image
0

823

serverwentdown/short repository overview

⁠short

A tiny, two-dependency, unauthenticated URL shortener service.

⁠Getting started

Start a cockroachdb server:

cockroach start --insecure
echo "CREATE DATABASE IF NOT EXISTS short;" | cockroach sql --insecure

Build and run short:

go build
./short -postgres postgresql://root@localhost:26257/short?sslmode=disable

⁠Usage

$ short -h
Usage of ./short:
  -baseurl string
    	baseurl URL of short links (default "localhost:port")
  -num int
    	number of characters in shortened url (default 4)
  -port int
    	listen on port (default 8080)
  -postgres string
    	postgres string (default "postgresql://root@localhost:26257/short?sslmode=disable")

See pq docs⁠ for more information on the postgres string.

Tag summary

Content type

Image

Digest

Size

3.6 MB

Last updated

almost 7 years ago

docker pull serverwentdown/short