Skip to content

Cyan903/lua-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-url-shortener

total lines last commit repo size

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.

Installation

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

Dependencies

rxi/log.lua and golgote/neturl don't exist on luarocks and are installed in the /lib directory.

About

URL shortening API written in lua. Similar to how bit.ly works.

Topics

Resources

Stars

Watchers

Forks