Serverless
You can also host the HTTP API yourself. The API is based on Cloudflare Workers and the Serverless Framework. A free Cloudflare Workers account contains 100.000 free requests. So just give it a try.
#
Installation#
Step 1First register on Cloudflare and add a domain to your account.
#
Step 2Checkout our repository avatars-serverless:
#
Step 3Change to the project directory and copy the file .env.dist
to .env
:
#
Step 4Edit the new created .env
file and enter the following data:
CLOUDFLARE_ACCOUNT_ID
- Log in to your Cloudflare account and select your domain.
- On the right, look for Account ID and click Click to copy below the input.
CLOUDFLARE_ZONE_ID
- Log in to your Cloudflare account and select your domain.
- On the right, look for Zone ID and click Click to copy below the input.
CLOUDFLARE_AUTH_KEY
- Log in to your Cloudflare account and navigate to My Profile => API Tokens.
- On the bottom, look for Global API Key and click View.
- Enter your password and click Click to copy below the input.
CLOUDFLARE_AUTH_EMAIL This is your account email address.
#
Step 5Install the dependencies:
#
Step 6Now you are ready to deploy the API with a simple command:
#
Step 7That's it. Your API should now be available in the worldwide network of Cloudflare. Create your first avatar: