Welcome to the documentation for the Product API. This project aims to provide a RESTful API for managing products.
The purpose of this project was to study unit tests, integration tests and virtualization using docker to maintain and manage postgreSQL's database image.
To install and set up the project locally, follow these steps:
- Clone the project repository from GitHub:
git clone https://github.com/alefnsc/product-api.git
- Navigate to the project directory:
cd product-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.
To perform tests you can run:
npm test
To try it on the watch mode, just run:
npm run watch
Product
- getProducts(): Retrieves all product.
- createProduct(product): Creates a new product.
- updateProduct(id, owner): Updates an existing product by its ID.
- deleteProduct(id): Deletes an owner by its ID.
-
jest: Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
-
supertest: Supertest is a Node. js library that allows developers and testers to test the APIs. It enables developers and testers to write automated tests for routes and endpoints.
-
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