"An API mande in Node with Express and PostgreSQL"
Welcome to the API project built on Node.js, Express and PostgreSQL! This application is a RESTful API that allows you to interact with a PostgreSQL database through HTTP endpoints. Combining the power of Node.js, the ease of use of the Express framework, and the reliability of PostgreSQL, this project provides a solid foundation for creating and managing efficient and scalable APIs.
- Defined Routes: The project implements RESTful routes to perform CRUD (Create, Read, Update, Delete) operations on specific resources. Each route is mapped to a corresponding controller, ensuring well-organized and maintainable code.
-
Database Connection: We use PostgreSQL as our database management system. Through the appropriate driver library, we establish secure and efficient connections for storing and retrieving data.
-
Middleware: Express.js allows us to implement middleware to handle requests before being directed to controllers. This allows for data validation, authentication, authorization, and other important functionality.
-
JSON Responses: The API responds in JSON format, which makes it easy to integrate with different types of clients, such as web and mobile apps.
- Prerequisites: Before starting, make sure you have Node.js and PostgreSQL installed on your machine.
-
Database Configuration: Create a dotenv file in your directory and put the connectionString with your information.
-
Installation of Dependencies: In the root directory of the project, run the following command to install the necessary dependencies:
- npm install
- yarn install
-
Running the Application: Start the API server with the following command:
- npm start
- yarn start
-
Exploring the API: You can now access the API through https://localhost:5000 (or another port if specified). See the documentation below for details on available endpoints and how to use them.
Full documentation for API endpoints can be found at https://localhost:5000/doc. Be sure to check supported methods, required parameters, and expected responses for each endpoint.
If you want to contribute to this project, I'm very happy to receive pull requests. Make sure you follow the contributing guidelines and test your changes properly.