Project to understand the Vercel hosting service.
Surprising, much easier than I expected... The name Vercel made me worried, but deploying a REST app on Vercel's serverless service takes less than 3 minutes. Sign up with your GitHub account, select the repository, and boom... perfect.
When I wrote this POC, I was with two people looking to learn JavaScript and Node.js, so this code was worth teaching them both simultaneously.
-- Willianson Araújo
This is a simple Node.js API that returns a list of products, allowing filtering by price, category, and name. The API supports multi-query parameters to perform the filtering.
Root API Address: https://poc-vercel-backend.vercel.app/products
Query Params
priceLower
: (Optional) Filters products with a price lower or equal to the specified value.category
: (Optional) Filters products by category.name
: (Optional) Filters products by name, allowing partial name matches (case-insensitive).
Examples
- GET /products
- GET /products?priceLower=100
- GET /products?category=Electronics
- GET /products?category=Electronics&priceLower=100
- Node.js installed.
- A package manager like
npm
oryarn
installed.
- Clone the repository or copy the source code.
- Navigate to the project directory.
- Run the following command to install the dependencies:
$ yarn
To start the server, run:
$ node index.js
The application is running on your http://localhost:3000