Skip to content
Snippets Groups Projects
README.md 6.32 KiB

imagehoster

Hive-powered image hosting and proxying service.

Developing

With node.js installed, run:

make devserver

This will pull in all dependencies and spin up a hot-reloading development server.

Run make lint to run the autolinter, make test to run the unit tests.

Configuration

Defaults are in <./config/default.toml> and can be overridden by env vars as defined in <./config/custom-environment-variables.toml>

Load order is: env vars > config/$NODE_ENV.toml > config/default.toml

See the config module docs for more details.

API

Responses should be determined by the Content-Type header, errors will have a status of >=400 and a Content-Type of application/json with the body in the format:

{
    "error": {
        "name": "error_name",
        "info": {"optional": "metadata"}
    }
}

POST /<username>/<signature> - upload an image.

Multipart image upload, will only consider first file if there are multiple.

Returns a JSON object containing the url to the uploaded image, example:

{
    "url": "https://images.example.com/DQmZi174Xz96UrRVBMNRHb6A2FfU3z1HRPwPPQCgSMgdiUT/test.jpg"
}

Requires a signature from a Hive account in good standing, see the "Signing uploads" section below for more information.

POST /hs/<accesstoken> - upload an image with Hivesigner accessToken.