1
0
Fork 0
 
 
Go to file
Ambrose Chua 5b8692a930 Revert mistakes 2019-01-09 14:39:51 +08:00
vendor Initial switch to vgo 2018-03-18 18:23:06 +08:00
.gitignore Initial commit 2017-10-02 23:08:54 +08:00
Dockerfile Update Dockerfile 2018-09-08 17:40:15 +08:00
LICENSE Create LICENSE 2017-10-02 20:13:20 +08:00
README.md Fix guide 2017-12-25 18:32:15 +08:00
assets.go Do not return promise 2017-10-03 20:04:32 +08:00
generate.go Updated CLI to use flags 2017-10-08 15:39:17 +08:00
go.mod Revert mistakes 2019-01-09 14:39:51 +08:00
go.sum Revert mistakes 2019-01-09 14:39:51 +08:00
handlers.go Health check data in another file 2018-02-26 23:11:34 +08:00
healthz.go Move pinger into healthz 2018-02-26 23:19:12 +08:00
main.go Initial switch to vgo 2018-03-18 18:23:06 +08:00
router.go Revert mistakes 2019-01-09 14:39:51 +08:00
store.go Prevent DoS when run out of IDs 2017-10-08 15:48:37 +08:00

README.md

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.