Home

Animasher

Backend for animasher.

Setup

Database and config, sample config.json is in _config.json.

Database initalized from install.sql.

Config values can be overriden by ENV variables. Names use PASCAL_CASE instead of camelCase. Object properties are separated as if they were just another words (i.e. mysql.supportBigNumbers -> MYSQL_SUPPORT_BIG_NUMBERS).

API

Authentication

Authentication is done by sending token in a header. The correct format is Authorization: token <token> (you can also send authorization header with value of just the token, but this may stop working in future).

Token is generated and returned from /user/login route.

Pagination

Most routes that return an array support pagination. Pagination works by using limit and page queries. Total count is sent in the X-Count header. The count header isn't implemented in every paginated endpoint (may be missing or null), in that case you'll need to fetch until you get less than the max.

Errors

bad_captcha

Captcha couldn't be verified

bad_format

Some required fields are missing from query

name_exists

Name already exists, and requested resource cannot be created.

login_error

Name or password is wrong

user_doesnt_exist

Requested user doesn't exist.

not_authorized

Missing token or permissions.

internal

Internal server error, try again later.

file_doesnt_exist

Requested file couldn't be found.

animation_doesnt_exist

Requested animation couldn't be found.

missing_perms

Missing user permission.

missing_reason

Reason is missing from the request