/MenheraAPI

An HTTP API to help MenheraBot

Primary LanguageTypeScriptMIT LicenseMIT


Logo

๐Ÿ”ง Menhera API ๐Ÿ”ง

An HTTP API to help some functionalities of MenheraBot
MenheraBot ยป

๐Ÿ“ก | MenheraAPI

Menhera's API is intended to manage:

  • Save command execution;
  • Keep shard statistics updated;
  • Save command info;
  • Serve user statistics.
  • Serve data to its WebSite.

๐Ÿ”€ | Routes

This repository is divided into 2 main routes, which serves different type of data:

Data

This is a private route protected with a secret token. It's used to update user statistics, save command execution.

Info

This route is open to the public. It's used to serve command info and shards info to MenheraBot's Website

๐Ÿ”ฅ | Running

To run the Api, you need to have Docker in your machine. You have two options of installation, follow the one that applies to you.

๐Ÿ”ฎ | Building the Image

If you want to build the image yourself, you can do it by following these steps:

  1. ๐Ÿงน Clone the repository
git clone https://github.com/MenheraBot/MenheraApi.git
  1. ๐Ÿ’ป Building the Image
docker build . --tag api
  1. ๐Ÿƒโ€โ™‚๏ธ Running a Container
docker run --name MenheraApi \
-e "API_TOKEN=" \
-e "PORT=" \
-e "MENHERA_AGENT=" \
-e "DATABASE_URL=" \
--restart unless-stopped \
-p 25156:25156 \
-d -t api

Obs: API_TOKEN and MENHERA_AGENT is just for authentication purposes. Database_url is the url of your postgres database, and port is the exposed port of Dockerfile. Is never good to have your API down, so the unless-stopped policy should handle any kind of error that could kill our API.

The api is on fire right now!.

๐ŸŽ‰ | Downloading the Image

If you don't really want all the source code, and just want to execute the bot, you can just donwload the image from the Container Registry.

  1. ๐Ÿ“ฅ Download the image
docker pull ghcr.io/menherabot/api:latest

You need to be logged in

  1. ๐Ÿƒโ€โ™‚๏ธ Running a Container
docker run --name MenheraApi \
-e "API_TOKEN=" \
-e "PORT=25156" \
-e "MENHERA_AGENT=" \
-e "DATABASE_URL=" \
-p 25156:25156
--restart unless-stopped \
-d -t ghcr.io/menherabot/api:latest

Obs: API_TOKEN and MENHERA_AGENT is just for authentication purposes. Database_url is the url of your postgres database, and port is the exposed port of Dockerfile, in this image is 25156. Is never good to have your API down, so the unless-stopped policy should handle any kind of error that could kill our API.

You have now a API running in you machine.

๐Ÿ”จ | Made With

๐Ÿ’– | Contributors


@ySnoopyDogy

@Tsugami

โš–๏ธ | License

Distributed under the MIT License. See LICENSE for more information.

๐Ÿ“ง | Contact

Discord: Luxanna#5757

Twitter: @Luxanna_Dev


MenheraBot was made with โค๏ธ by Luxanna.