Welcome to the documentation for the Petshop API. This project aims to provide a RESTful API for managing petshop services.
To install and set up the project locally, follow these steps:
- Clone the project repository from GitHub:
git clone https://github.com/alefnsc/petshop-api.git
- Navigate to the project directory:
cd petshop-api
- Install project dependencies using npm:
npm install
After installation, you can start the server by running:
npm start
This will start the Express server and make the API available at http://localhost:3000.
ElephantSQL(Postgres)
-
getOwners(): Retrieves all owners.
-
getOwner(id): Retrieves an owner by its unique ID.
-
createOwner(owner): Creates a new owner.
-
updateOwner(id, owner): Updates an existing owner by its ID.
-
deleteOwner(id): Deletes an owner by its ID.
-
getPets(): Retrieves all pets.
-
getPet(id): Retrieves an pet by its unique ID.
-
createPet(pet): Creates a new pet.
-
updatePet(id, pet): Updates an existing pet by its ID.
-
deletePet(id): Deletes an pet by its ID.
-
getService(id): Retrieves an service by its unique ID.
-
createService(service): Creates a new service.
MongoDB Atlas
- getPost(): Retrieves all posts.
- createPet(post): Creates a new post.
- creteComment(postId, comment[nome, conteudo]): Create a new comment on existing post by MongoDB ID.
To view object model check Models.
-
cors: A package that enables Cross-Origin Resource Sharing (CORS) in Express applications, allowing controlled access to resources from different origins.
-
express: A popular web application framework for Node.js used to create APIs and web servers. It simplifies routing, middleware, and handling HTTP requests.
-
mongodb: The official MongoDB driver for Node.js, providing methods for interacting with MongoDB databases.
-
nodemon: A tool that monitors changes in your source code and automatically restarts the Node.js application when changes are detected. Great for development.
-
pg: A PostgreSQL client for Node.js that enables you to interact with PostgreSQL databases.
-
sequelize: A promise-based Node.js ORM (Object-Relational Mapping) for relational databases like PostgreSQL, MySQL, SQLite, etc.
-
winston: A popular logging library for Node.js that offers flexible and configurable logging options.
- Maintainer: Alexandre Fonseca
- Email: alexandrefonsecach@gmail.com