This is a simple RESTful API built with Node.js and Express framework.
Before you begin, ensure you have met the following requirements:
- Node.js installed on your local machine. You can download and install it from Node.js official website.
- npm (Node Package Manager) installed. npm is typically installed alongside Node.js.
To get a local copy up and running follow these simple steps:
- Clone the repository to your local machine:
git clone https://github.com/JeffeVargasP/e-commerce.git
- Navigate into the project directory:
cd e-commerce
- Install dependencies using npm:
npm install
- Start the server:
npm start
Once the server is running, you can send HTTP requests to interact with the API. The available endpoints are listed below:
-
GET /api/order
: Retrieves all orders. -
GET /api/order/:id
: Retrieves a specific order by ID. -
POST /api/order
: Creates a new order. -
DELETE /api/order/:id
: Deletes an order by ID. -
GET /api/user
: Retrieves all users. -
GET /api/user/:id
: Retrieves a specific user by ID. -
POST /api/user
: Creates a new user. -
DELETE /api/user/:id
: Deletes a user by ID. -
GET /api/product
: Retrieves all products. -
GET /api/product/:id
: Retrieves a specific product by ID. -
POST /api/product
: Creates a new product. -
PATCH /api/product/:id
: Updates an existing product by ID. -
DELETE /api/product/:id
: Deletes a product by ID.
Please note that for endpoints requiring data input, you should include the appropriate JSON payload in the request body.
You can configure the server port and other settings by modifying the config.js
file (Change example.config.js to config.js).
- Express - Fast, unopinionated, minimalist web framework for Node.js.
- body-parser - Node.js body parsing middleware.
- bcrypt - A library to help you hash passwords.
- jsonwebtoken - JSON Web Token implementation for node.js.
- mysql2 - MySQL client for Node.js with focus on performance.
- Sequelize - A promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
E-mail - [email protected]
Project Link: https://github.com/JeffeVargasP/e-commerce
Made with 💛 and ☕ by @JeffeVargasP