A beginner-friendly Node.js and Express application that serves structured product data from a local JSON file.
This project demonstrates basic API development, asynchronous file handling, JSON responses, and static-file hosting.
- Starts an Express server on port
3000by default - Serves static files from the
publicdirectory - Provides a
GET /productsendpoint - Reads product records asynchronously from
data/full-products.json - Returns JSON data to the client
- Returns a JSON error response when the data file cannot be read
- Node.js
- Express.js
- JavaScript
- JSON
- Nodemon
fullstack-products-api/
├── app.js
├── package.json
├── data/
│ └── full-products.json
├── public/
└── README.md
Install a current version of Node.js and npm.
Clone the repository:
git clone https://github.com/JashvanthiPriyanka2910/fullstack-products-api.git
cd fullstack-products-apiInstall the dependencies:
npm installStart the application:
npm startThe server uses port 3000 unless the PORT environment variable is set.
GET /productsExample local URL:
http://localhost:3000/products
The endpoint returns the product records stored in data/full-products.json.
- Product data is stored in a local JSON file
- The current version provides a read-only product endpoint
- Automated tests have not yet been added
- Database persistence and full CRUD operations are outside the current implementation
- Add pagination and filtering
- Add a single-product endpoint
- Add input validation and consistent error handling
- Add automated API tests
- Move product storage to a database
- Add create, update, and delete operations
Developed from graduate-course materials and maintained as a learning and portfolio project. The documentation describes only the functionality currently present in this repository.
Jashvanthi Priyanka