1.0.0 • Published 8 months ago
@nec0ti/librisapi v1.0.0
LibrisAPI
LibrisAPI is a RESTful API for managing your personal book collection.
Purpose
This API allows you to:
- Create, retrieve, update, and delete books.
- Authenticate users with JWT (JSON Web Tokens).
Documentation
For detailed information on how to use the API, please refer to the LibrisAPI Documentation.
Getting Started
Clone the repository:
git clone https://github.com/Nec0ti/LibrisAPI/ cd LibrisAPIInstall dependencies:
npm installSet up environment variables:
Create a
.envfile with the following variables:MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority JWT_SECRET=your_jwt_secret_keyStart the server:
npm run dev
Endpoints
Here are a few basic examples:
Register:
POST /api/auth/register{ "username": "testuser", "password": "testpassword" }Login:
POST /api/auth/login{ "username": "testuser", "password": "testpassword" }Get All Books:
GET /api/books(requires JWT token inx-auth-tokenheader)
Contributing
We welcome contributions! Please feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License.
1.0.0
8 months ago