summaryrefslogtreecommitdiffstats
path: root/README.markdown
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-08 19:18:39 +0200
committerlassulus <lass@aidsballs.de>2015-10-08 19:19:04 +0200
commit05d02740e0adbb36cc461323647f0c1e7f493156 (patch)
treeda4d905b5e32e621f5760102805e7b38e051abcb /README.markdown
adopt from krebscode/painloadHEADmaster
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown54
1 files changed, 54 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
new file mode 100644
index 0000000..22b7c64
--- /dev/null
+++ b/README.markdown
@@ -0,0 +1,54 @@
+# go - minimalistic uri shortener
+
+## install dependencies
+
+ npm install
+
+ apparently you can also
+
+ npm install hiredis
+
+ for more awesome.
+
+## run service
+
+ PORT=80 node .
+
+ if you omit `PORT`, then it's `1337`.
+
+ there's also the possibility to change the Redis key prefix which
+ defaults to `go:` with
+
+ REDIS_KEY_PREFIX=foobarmyprefix/
+
+## add uri
+
+ curl -F uri=https://mywaytoolonguri http://localhost:1337
+
+ this will give you a shortened uri.
+
+## resolve uri
+
+ curl -L http://localhost:1337/1
+
+## clear database
+
+ redis-cli keys 'go:*' | xargs redis-cli del
+
+ if you have changed `redisPrefix`, then use that instead of `go:`.
+
+## use systemd
+
+ run
+
+ make install
+
+ to install the systemd service and configuration files.
+ this will fail if the files are already installed and modified.
+
+ configure `HOSTN` and `PORT` in `/etc/conf.d/go.env` and the user
+ and/or group in `/etc/systemd/system/go.service`.
+
+ and finally start the service with
+
+ systemctl start go