Squabble is a comment server built on Lumen, using a SQLite backend for storing comment data.
It is built for use on http://savaslabs.com although you could easily adapt it for your own site, with a bit of time and server to spare.
cd /path/to/squabble
composer install
touch /path/to/squabble/storage/database.sqlite
php artisan migrate
Important: Your site won't work without a .env
file in the root of the repo. Please reference env.example
for the contents of the .env
file.
cd /path/to/squabble
php artisan serve
The server is now listening at http://localhost:8000
The following routes are defined:
api/comments
- Returns an array of all comments stored on the serverapi/comments/id/{id}
- Get a comment by numeric IDapi/comments/post/{slug}
- Get a comment by the URL of the post it's associated withapi/comments/count
- Get an array of comment count per postsapi/comments/delete/{id}/{token}
- Delete a comment by ID, using a unique token for that comment. The token is emailed out when the comment is saved.
The following route is defined:
api/comments/new
- Save a new comment.
Example POST request:
curl -i -H 'Content-Type: application/json' -XPOST 'http://localhost:8000/api/comments/new' -d '{
"name": "Some author",
"email": "a@b.com",
"comment": "A comment would go here",
"slug": "2015/04/27/durham-restaurant-time-machine.html",
"nocaptcha": "owl"
}'