URL shortening API written in lua. Similar to how bit.ly works. This isn't meant to be a serious project and I made it mostly for getting better at the language. This api won't scale at all and I probably spent more time writing helper functions than actually writing the api.
This api requires MySQL (or MariaDB) to be installed and configured. First install the required luarocks.
$ luarocks install http
$ luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql # or wherever you have your mysql dir.
$ luarocks install json-lua
Execute ext/db.sql
.
$ mysql -u user -p
mysql> source /path/to/api/ext/db.sql;
Copy and configure config.json
.
$ cp ext/config.sample.json ./config.json
$ nano config.json
Finally, run the api with:
$ lua app.lua
rxi/log.lua
and golgote/neturl
don't exist on luarocks and are installed in the /lib
directory.