Subject Management REST-API (Tested with Postman)
/
--> Landing Page
- POST
/users/register
--> register a user
- POST
/user/authenticate
--> user auth
- GET
/subjects
--> Create a subject
- GET
/subjects/:subjectID
--> Get subject by ID
- POST
/subjects
--> Add a new subject
- PUT
/subjects/:subjectID
--> Update Subject by ID
- DELETE
/subjects/:subjectID
--> Delete a Subject
const SubjectSchema = new Schema({
name: {
type: String,
trim: true,
required: true,
},
professor: {
type: String,
trim: true,
required: true
}
});
const UserSchema = new Schema({
name: {
type: String,
trim: true,
required: true,
},
email: {
type: String,
trim: true,
required: true
},
password: {
type: String,
trim: true,
required: true
}
});
- Runtime: Node.JS
- REST Framework: Express
- Database: MongoDB
User Registration
User Auth
GET Subjects
Auth Validation