AniX/api-prox
2025-08-28 21:47:34 +05:00
..
episode chore/api-prox: add README 2025-07-08 14:34:15 +05:00
hooks eat/api-prox: add request timeout to release.ts hook 2025-07-09 02:12:50 +05:00
.dockerignore CI: add build CI for api-prox 2025-07-08 14:43:42 +05:00
Dockerfile refactor/api-prox: unhardcode HOST and PORT to ENV VARS 2025-07-08 16:26:28 +05:00
iframe.ts feat/api-prox: use custom player instead of iframe 2025-07-07 17:30:23 +05:00
index.ts api-prox/fix: discovery for not logged in users 2025-08-28 21:47:34 +05:00
media-chrome.ts feat/api-prox: use custom player instead of iframe 2025-07-07 17:30:23 +05:00
package-lock.json feat: start implementing api proxy with ability to use hooks: #8 2025-06-27 00:19:03 +05:00
package.json feat: start implementing api proxy with ability to use hooks: #8 2025-06-27 00:19:03 +05:00
README.md chore/api-prox: add README 2025-07-08 14:34:15 +05:00
README.RU.md chore/api-prox: add README 2025-07-08 14:34:15 +05:00
shared.ts feat: Refactor: search #12 2025-08-22 04:01:44 +05:00
tsconfig.json feat/api-prox: add types 2025-07-02 20:35:53 +05:00

AniX - Api Proxy

This sub-project allows proxying requests to the Anixart API and modifying their responses using hooks.

It can be used both for the main AniX project and as a standalone service for the Android app with a modified API link.

License: MIT

Available Hooks

  • release.ts: adds a rating from Shikimori to the additional info line
  • profile.example.ts: changes the nickname of the official Anixart account (an example of using a hook)
  • profile.sponsor.ts: enables sponsorship (disables ads) after logging into the account in the Android app
  • toggles.ts: replaces the configuration response; if the HOST_URL environment variable is present, it replaces the web player link with an embedded one; when used together with the PLAYER_PARSER_URL variable, enables the custom web player, as in the AniX web client
  • episode.disabled.ts: allows modifying/adding voiceovers, sources, and episodes using a JSON file in the episode folder.

Usage

In the web browser address bar, enter:

<http|https>://<ip|domain><:port>/<ENDPOINT>[?<QUERY_PARAMS>]

Response:

  • 500: an error occurred, see the reason field in the response body for more details
  • 200: request was successful (if there was an error on the Anixart API side, see the code field)

Deployment

Docker

Requirements:

Pre-built

  1. Run the command:

docker run -d --name anix-api -p 7001:7001 radiquum/anix-api-prox:latest

To use hooks, create a hooks folder and add the flag -v ./hooks:/app/hooks before the -p flag. (The same applies to the episode folder if needed)

Manual Build

Additional Requirements:

  1. Clone the repository: git clone https://github.com/Radiquum/AniX
  2. Navigate to the repository directory: cd AniX
  3. Navigate to the service directory: cd api-prox
  4. Run the command: docker build -t anix-api-prox .
  5. After completion, run: docker run -d --restart always --name anix-player -p 7001:7001 anix-api-prox

To use hooks, add the flag -v ./hooks:/app/hooks before the -p flag. (The same applies to the episode folder if needed)

docker/Flags

  • -d - run the container in background
  • --restart always - always start after server reboot
  • --name - container name
  • -p - container port that will be accessible from outside. PORT:7000
  • -v - mount a folder from host into the container

docker/After Deployment

The service will be available at: http://<YOUR IP><:YOUR PORT>/

docker/Note

To use your own domain and support HTTPS, you can use Traefik or another reverse proxy with an SSL certificate.

Useful links:

pm2

Requirements:

Instructions:

  1. Clone the repository: git clone https://github.com/Radiquum/AniX
  2. Navigate to the repository directory: cd AniX
  3. Navigate to the service directory: cd api-prox
  4. Run: npm install
  5. After completion, run: pm2 start index.ts -n anix-api-prox

pm2/Flags

  • -n - service name in pm2

pm2/After Deployment

The service will be available at: http://<YOUR IP>:7001/

pm2/Note

For automatic app startup, it is recommended to set up pm2 autostart using the command: pm2 startup

Useful links: