diff --git a/README.md b/README.md index 7b1769b..4746161 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MuscleLib API -![Version](https://img.shields.io/badge/version-2.1.0-orange.svg) ![Node.js](https://img.shields.io/badge/node.js-%3E%3D20%20%3C23-green.svg) ![License](https://img.shields.io/badge/license-MIT-blue.svg) +![Version](https://img.shields.io/badge/version-2.3.0-orange.svg) ![Node.js](https://img.shields.io/badge/node.js-%3E%3D20%20%3C25-green.svg) ![License](https://img.shields.io/badge/license-MIT-blue.svg) ## About @@ -36,10 +36,25 @@ Search uses **fuzzy matching** via Fuse.js, so you don't need exact spelling. Fi ## Base URL ``` -https://musclelib-api.vercel.app +https://libapi.vercel.app ``` -> All endpoints below use this base URL. Replace with `http://localhost:5000` for local development. +> All production examples use this verified production URL. For local development, set `PORT=5000` in your `.env` file and use `http://localhost:5000`. The server reads its port from `process.env.PORT` and does not define a default port. + +## Local Development + +The application loads environment variables from `.env`. At minimum, configure `PORT`, `MONGODB_URI`, `MONGODB_NAME`, and `DOCS` before starting the server. Example local port configuration: + +```dotenv +PORT=5000 +``` + +Install dependencies and start the development server: + +```bash +npm ci +npm run dev +``` ## API Endpoints @@ -100,7 +115,7 @@ Likewise, send `page` and `limit` at most once each. A repeated `page` or `limit **Example:** ```bash -curl "https://musclelib-api.vercel.app/api/exercises?lang=en&page=0&limit=5&force=pull" +curl "https://libapi.vercel.app/api/exercises?lang=en&page=0&limit=5&force=pull" ``` **Response (200):** @@ -135,7 +150,7 @@ curl "https://musclelib-api.vercel.app/api/exercises?lang=en&page=0&limit=5&forc **Response (400 — unsupported query parameter):** ```bash -curl "https://musclelib-api.vercel.app/api/exercises?muscle=chest" +curl "https://libapi.vercel.app/api/exercises?muscle=chest" ``` ```json { @@ -179,7 +194,7 @@ import scripts in other processes become visible through expiration. **Example:** ```bash -curl "https://musclelib-api.vercel.app/api/exercises/search?query=squat&lang=en" +curl "https://libapi.vercel.app/api/exercises/search?query=squat&lang=en" ``` **Response (200):** @@ -224,7 +239,7 @@ Returns all available filter values aggregated from the database. **Example:** ```bash -curl "https://musclelib-api.vercel.app/api/exercises/filters?lang=en" +curl "https://libapi.vercel.app/api/exercises/filters?lang=en" ``` **Response (200):** @@ -259,7 +274,7 @@ Serves an exercise image directly. Each exercise has two images (`0.jpg` and `1. **Example:** ```bash -curl "https://musclelib-api.vercel.app/api/exercises/Barbell_Curl/0.jpg" -o image.jpg +curl "https://libapi.vercel.app/api/exercises/Barbell_Curl/0.jpg" -o image.jpg ``` **Response:** JPEG image (200) or JSON error (400). @@ -276,7 +291,7 @@ Returns total exercise and image counts. **Example:** ```bash -curl "https://musclelib-api.vercel.app/stats" +curl "https://libapi.vercel.app/stats" ``` **Response (200):** diff --git a/package-lock.json b/package-lock.json index 4ae352c..54e4fbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "musclelib-api", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "musclelib-api", - "version": "2.1.0", + "version": "2.3.0", "license": "MIT", "dependencies": { "axios": "^1.16.1", @@ -32,7 +32,7 @@ "supertest": "^7.2.2" }, "engines": { - "node": ">=20 <23" + "node": ">=20 <25" } }, "node_modules/@babel/code-frame": { diff --git a/package.json b/package.json index 4d7fc24..bfd1fd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "musclelib-api", - "version": "2.2.0", + "version": "2.3.0", "description": "MuscleLib API is a RESTful API for searching exercises, with support for multiple languages and pagination. It was built using Node.js and Express.js, and it uses a MongoDB database.", "main": "server/start.js", "scripts": { @@ -46,7 +46,7 @@ "walk-up-path": "^4.0.0" }, "engines": { - "node": ">=20 <23" + "node": ">=20 <25" }, "devDependencies": { "@eslint/js": "^10.0.1", @@ -61,4 +61,4 @@ "url": "https://github.com/MuscleLib/musclelib-api/issues" }, "homepage": "https://github.com/MuscleLib/musclelib-api" -} \ No newline at end of file +}