/netlify-express-api

Simple Express REST API to convert torrent file to magnet URI

Primary LanguageJavaScript

Simple Express REST API on Netlify

Netlify Deploy Netlify Status

Simple Express REST API on Netlify to convert torrent file to magnet URI

Features

  • Babel 7
  • Environment Variables
  • Express
  • REST API

Requirements

Installation

  • git clone git@github.com:dotiful/netlify-express-api.git
  • cd netlify-express-api
  • npm install
  • npm run start
  • optional: include .env in your .gitignore

Examples of how to access the Express.js endpoints

Check API reference at apiary.io

CURL

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"url":"https://mac-torrents.io/wp-content/uploads/2019/06/Visual-Studio-Code-1.35.1.zip.torrent"}' \
  http://localhost:3000/magnet

Postman

  • Install Postman to interact with REST API
  • Create a magnet URI from a torrent file:
    • URL: http://localhost:3000/magnet
    • Method: POST
    • Body Content: url=https://mac-torrents.io/wp-content/uploads/2019/06/Visual-Studio-Code-1.35.1.zip.torrent