This repository contains a sampple API server that can be self hosted and provides convenient access to the Map3 Trustless Crypto Assets database.
git clone [email protected]:map3xyz/api
yarn install
A sample environment configuration is provided in the .env.sample file in the root of the repository.
There are 3 variables that can be configured, their usage is as follows:
ASSETDB_DIR - The folder in which the cached database will be downloaded and read
SERVER_PORT - The port on which API server will listen for requests
JWT_SECRET - (Optional) if you wish to secure your API, define a JWT secret that is used to verify any JWT authorised requests token
We recommend that you start the server wrapped by 'forever' to ensure it is restarted automatically if the server nodejs process crashes. This will ensure maximum availability.
forever start -c "yarn start" -l api.log --append ./ &