https://github.com/serverwentdown/short
A tiny, two-dependency, unauthenticated URL shortener service
https://github.com/serverwentdown/short
golang golang-application url-shortener
Last synced: 12 months ago
JSON representation
A tiny, two-dependency, unauthenticated URL shortener service
- Host: GitHub
- URL: https://github.com/serverwentdown/short
- Owner: serverwentdown
- License: mit
- Created: 2017-10-02T12:12:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T06:40:06.000Z (over 7 years ago)
- Last Synced: 2025-03-30T07:42:49.602Z (about 1 year ago)
- Topics: golang, golang-application, url-shortener
- Language: Go
- Homepage: https://hub.docker.com/r/serverwentdown/short
- Size: 132 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters) for more information on the postgres string.