A learning-focused Express.js API prototype that demonstrates backend routing, query parameters, JSON data retrieval, static-file serving, and basic product endpoint design.
This repository originated from graduate coursework and is presented as a documented portfolio prototype.
The application currently:
- Starts an Express server on port
3000by default - Serves static files from the
publicdirectory - Reads product records from a local JSON file
- Lists products with pagination controls
- Filters products by tag
- Retrieves a single product by ID
- Includes prototype create, update, and delete route handlers
- Uses middleware for JSON request bodies and CORS support
| Method | Endpoint | Current behavior |
|---|---|---|
GET |
/ |
Serves the application home page |
GET |
/products |
Returns products from the local JSON dataset |
GET |
/products?offset=0&limit=25 |
Returns a paginated product list |
GET |
/products?tag=<tag> |
Filters products by tag |
GET |
/products/:id |
Returns one matching product |
POST |
/products |
Prototype handler that returns the submitted request body |
PUT |
/products/:id |
Prototype handler that returns the submitted changes |
DELETE |
/products/:id |
Prototype handler that returns a success response |
- Node.js
- Express.js
- JavaScript
- JSON
- REST-style routing
- Nodemon
- CORS middleware
express-products-api-prototype/
├── app.js
├── api.js
├── products.js
├── middleware.js
├── package.json
├── index.html
├── data/
├── lib/
└── public/
- Clone the repository.
- Install the dependencies:
npm install- Start the application:
npm start- Open:
http://localhost:3000
List the first ten products:
GET /products?offset=0&limit=10
Filter by a product tag:
GET /products?tag=nature
Retrieve one product:
GET /products/<product-id>
- Express server configuration
- REST-style endpoint design
- Route-handler organization
- Asynchronous file operations
- JSON parsing and filtering
- Query-parameter handling
- Pagination logic
- Middleware integration
- Basic error-path handling
- Product data is read from a local JSON file.
- Create, update, and delete operations are prototype responses and do not persist changes.
- MongoDB persistence is not implemented in the current code.
- Automated tests are not currently configured.
- Production authentication, validation, logging, and security controls are outside the project scope.
- Add persistent database storage
- Validate incoming request data
- Add structured error responses
- Implement complete CRUD operations
- Add automated API tests
- Add API documentation with OpenAPI or Swagger
This repository contains coursework-based learning material and sample product data. It does not contain employer-confidential information, internal systems data, or real customer records.
Jashvanthi Priyanka