Skip to content

problem-solver444/simple-courses-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 API CodeZone

A simple Node.js + Express.js project that provides a RESTful API for managing courses (CRUD Operations).
The API supports creating, reading, updating, and deleting courses with validation using express-validator.


🚀 Tech Stack


📂 Project Structure

API CodeZone/
│── Controllers/
│   └── Courses.controllers.js
│── Data/
│   └── Courses.js
│── MiddleWares/
│   └── ValidationSchema.js
│── Routers/
│   └── Courses.Router.js
│── index.js
│── package.json
│── package-lock.json

⚙️ Installation & Running the Project

  1. Clone the repository

    git clone <repo-link>
    cd API-CodeZone
  2. Install dependencies

    npm install
  3. Run the server

    nodemon index.js

    The server will start on:

    http://localhost:3000
    

📌 API Endpoints

🔹 Get all courses

GET /api/Courses

🔹 Get course by ID

GET /api/Courses/:CourseId

🔹 Create a new course

POST /api/Courses

Request Body:

{
  "title": "React",
  "price": 4000
}

🔹 Update a course

PATCH /api/Courses/:CourseId

🔹 Delete a course

DELETE /api/Courses/:CourseId

✅ Validation Rules

  • title: must not be empty and must be at least 2 characters.
  • price: must not be empty, must be an integer, and must be greater than or equal to 100.

🎯 Project Idea

A simple API performing CRUD operations on courses.
The project demonstrates:

  • Express.js Routers & Controllers
  • Middleware usage
  • Data handling in memory
  • Request validation with express-validator

👨‍💻 Author

Developed as a practice project for learning Node.js and Express.js.

About

A simple Node.js + Express API performing CRUD operations on Courses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published