rajput-hemant / jiosaavn-api-ts

đŸŽĩ A simple wrapper for the JioSaavn API powered by Hono.js đŸ”Ĩ.
https://jiosaavn.rajputhemant.tech
MIT License
19 stars 28 forks source link
api bun-api bun-runtime bunjs honojs jiosaavn-api jiosaavn-downloader music music-api nodejs typescript vercel
![][ci] ![][views] ![][stars] ![][forks] ![][issues] ![][license] ![][code-size] ![][commit-activity] # đŸŽĩ Jio Saavn API ### A simple wrapper for the Jio Saavn API powered by Hono.js đŸ”Ĩ. [**📚 Documentation**](https://docs-jiosaavn.netlify.app/) (in progress) ## ✨ Features
## 🛠ī¸ Building from source
git clone https://github.com/rajput-hemant/jiosaavn-api-ts
cd jiosaavn-api-ts
bun i || pnpm i || npm i || yarn

Bun

Warning You need to have Bun.js installed on your machine to run the project with bun.

bun run dev || pnpm dev || npm run dev || yarn dev

Node.js

bun run dev:node || pnpm dev:node || npm run dev:node || yarn dev:node

Vercel Dev Server

bun run dev:vercel || pnpm dev:vercel || npm run dev:vercel || yarn dev:vercel

Cloudflare Workers

Warning Make sure to remove Node API code from src/index.ts & config.ts before deploying or running the project with Cloudflare Workers.

src/index.ts

...

-  port: +(process.env.PORT ?? 3000),
+ port: 3000, # update accordingly

...

src/lib/config.ts

...

-  enableRateLimit: process.env.ENABLE_RATE_LIMIT === "true" ?? false,
+  enableRateLimit: false, # update accordingly
...
bun run dev:vercel || pnpm dev:cf || npm run dev:cf || yarn dev:cf
## 🌐 Deploying your own instance You can easily deploy your own hosted version of the `JioSaavn API` by clicking on one of the links below, which will set up a ready-to-go version for you: [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/rajput-hemant/jiosaavn-api-ts) [![Deploy with Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/rajput-hemant/jiosaavn-api-ts) **OR** ## Deploying using CLI

Vercel

bun run deploy:vercel || pnpm deploy:vercel || npm run deploy:vercel || yarn deploy:vercel

Note We are using community based 🐰 Bun runtime for ▲ Vercel Serverless Functions by default, You can also use ▲ Vercel Serverless Functions w/ Node Runtime or ▲ Vercel Edge Functions to deploy the project. To use Node Runtime or Edge Functions rename the _api folder to api and remove 'buildCommand' from vercel.json file.

Cloudfare Workers

bun run deploy:cf || pnpm deploy:cf || npm run deploy:cf || yarn deploy:cf

Build and Run Docker Image

Docker Compose (Recommended)

docker-compose up -d # detached mode
docker-compose stop # stops the container
docker-compose down # stops and removes the container

Docker

sudo dockerd
docker build -t jiosaavn .
docker run -p 80:3000 jiosaavn
docker ps
docker stop <container-id>
## 📜 License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## đŸĻž Contributors: