Releases: Programador-jr/MuscleLibAPI
v1.1.3
MuscleLib API - v1.1.3
Changes and Improvements
-
[#21 chore: bump mongoose from 8.9.3 to 8.9.5](#21)
- Updated Mongoose to version 8.9.5 via Dependabot.
-
[#22 feat: add new endpoints and improve error logs](#22)
- Added new API endpoints.
- Improved error logging system.
-
[#23 refactor: improve error handling and parameter validation](#23)
- Refactored error handling for better reliability.
- Improved parameter validation.
-
[#24 fix: improve search error handling and language fallback](#24)
- Fixed search error handling.
- Improved language fallback system.
-
[#25 fix: improve error handling, language fallback, and update image route](#25)
- Enhanced error handling and language fallback.
- 🚨 Images moved to a new route (see "Deprecated" section).
-
[#26 feat: add documentation page](#26)
- Added API documentation page.
-
[#27 feat: improve code structure and update dependencies](#27)
- Updated all dependencies to their latest versions.
- Improved overall code organization.
-
[#28 feat: improve code structure and update dependencies](#28)
- Refined HTML and CSS for better readability and styling consistency.
-
[#29 chore: update .gitignore](#29)
- Updated
.gitignoreto exclude unnecessary files from the repository.
- Updated
-
[#30 chore: git configuration](#30)
- Adjusted Git configuration.
⚠️ Deprecated
- Image route moved:
- The
/exercises/{exerciseName/{exerciseIndex}.jpgroute is now deprecated and replaced by/api/exercises/{exerciseName/{exerciseIndex}.jpg. - Please update your code to use the new route, as the old one will be removed in a future version.
- The
v1.1.2
Release Notes: API MuscleLib v1.1.2
Bug Fix in Search Endpoint
-
Identified Issue:
A bug in the/api/exercises/searchendpoint caused failures when processing search queries due to an undefined variable (formattedExercises), leading to inconsistent API responses. -
Fix Implemented:
- The issue was resolved by replacing
formattedExerciseswith the correct variable name (matchedExercises), ensuring that search results are returned as expected.
- The issue was resolved by replacing
Localized Logs (EN and PT)
-
Improvement Added:
The API now adapts its error logs and internal messages to the language specified in thelangparameter (enorpt).- If
lang=en: Logs are displayed in English. - If
lang=pt: Logs are displayed in Portuguese.
- If
-
Benefits:
- Easier error interpretation for developers in different languages.
- Improved consistency with the language used in the API requests.
Updated Usage Example
-
Search Request:
GET https://libapi.vercel.app/api/exercises/search?lang=pt&query=crucifix
-
Corresponding Log:
- PT:
Nenhum exercício encontrado para o termo: crucifix - EN:
No exercises found for the term: crucifix
- PT:
This update enhances the developer experience by providing clearer logs and resolving a critical issue in the search endpoint.
v1.1.1
Release Note - Exercise API
Version: 1.1.1
What's New
-
Enhanced Image Organization:
- Exercise images are now structured in folders named after the respective exercises, simplifying access.
- Each folder contains images related to the exercise, sequentially numbered (e.g.,
0.jpg,1.jpg).
-
Direct Image Access via URL:
- Images can now be accessed directly using the endpoint
/exercises/{exerciseName}/{imageIndex}.jpg. - Example URLs:
https://libapi.vercel.app/exercises/3_4_Sit-Up/0.jpghttps://libapi.vercel.app/exercises/3_4_Sit-Up/1.jpg
- Images can now be accessed directly using the endpoint
Developer Impact
- Simplified Image Management: No need to store images in the database. They can be referenced directly through the API.
- Frontend Integration Ready: Images can be easily used in frontend projects, including dynamic implementations like alternating images to mimic a GIF.
Frontend Usage Example
if (exercise.images && exercise.images.length > 0) {
const img = document.createElement('img');
img.src = `https://libapi.vercel.app/exercises/${exercise.images[0]}`; // First image
img.alt = exercise.name;
document.body.appendChild(img);
// Image alternation
let currentIndex = 0;
setInterval(() => {
currentIndex = (currentIndex + 1) % exercise.images.length;
img.src = `https://libapi.vercel.app/exercises/${exercise.images[currentIndex]}`; // Update the image
}, 1500); // Switch every 1.5 seconds
}Full Changelog: 1.1...v1.1.1
v1.1.0
Release Note - Exercise API
Version: 1.1.0
New Features
-
Added multilingual support (
enandpt):- Routes now accept the
langparameter to determine the language of the returned information. - Default language set to
en(English) if thelangparameter is not specified.
- Routes now accept the
-
Paginated Listing Route:
- Endpoint:
/api/exercises - Pagination support with
pageandlimitparameters. - Example usage:
GET /api/exercises?lang=pt&page=0&limit=50
- Endpoint:
-
Multilingual Search Route:
- Endpoint:
/api/exercises/search - Optimized search using Fuse.js library, which uses similarity logic to find matches.
- The search language is determined by the
langparameter.
Example:GET /api/exercises/search?lang=pt&query=crucifixo
- If the language is not specified, the search is conducted in English.
- Endpoint:
Improvements
- Language Validation: The API validates if the specified language (
lang) is supported, returning an appropriate error if invalid. - Data Formatter: Implementation of a centralized function to format returned data based on the language (
formatExercise), ensuring consistency in results. - Cleaner Structure:
- Modularized code with reusable validations and formatting.
- Clear error messages in case of issues in search or listing.
Next Steps
- Implement pagination in the search route (
/search) for large volumes of results. - Add support for more languages in the future.
v0.0.1
What's Changed
- Requisições simples pelo metodo GET
Full Changelog: https://github.com/Programador-jr/ExerciseApi/commits/1.0