All api calls return json
Get all the users from the database.
GET http://localhost:3000/api/users
Get a user based on the id provided in the request url
GET http://localhost:3000/api/users/id
Parameters | Description |
---|---|
id | The id of the user |
Update a user based on the id provided in the request url and the data provided in the request.
PUT http://localhost:3000/api/users/id
Parameters | Description |
---|---|
id | The id of the user |
Delete a user based on the id provided in the request.
DELETE http://localhost:3000/api/users/id
Parameters | Description |
---|---|
id | The id of the user |
Count the number of users in the database.
GET http://localhost:3000/api/countUsers
Sign the user up based on their input using Passport.
POST http://localhost:3000/signup
Log the user in based on their input (email and password) using Passport.
POST http://localhost:3000/login
Log the current user out using password.
POST http://localhost:3000/logout
Check if the current user is logged in. If so return the user else return 0.
GET http://localhost:3000/loggedin
Check if the current user is logged in and if he/she has an admin role.
GET http://localhost:3000/loggedinadmin
Get the userdata of the current logged in user.
GET http://localhost:3000/api/userData
Get all the projects from the database.
GET http://localhost:3000/api/projects
Create a project based on the data provided in the request and save it in the database.
POST http://localhost:3000/api/projects
Get a project based on the id provided in the request url
GET http://localhost:3000/api/projects/id
Parameters | Description |
---|---|
id | The id of the project |
Update a project based on the id provided in the request url and the data provided in the request.Get a project based on the id provided in the request url
PUT http://localhost:3000/api/projects/id
Parameters | Description |
---|---|
id | The id of the project |
Delete a project based on the id provided in the request.
DELETE http://localhost:3000/api/projects/id
Parameters | Description |
---|---|
id | The id of the project |
Increase the vote of a project based on the id provided in the request.
POST http://localhost:3000/api/projects/votes/id
Parameters | Description |
---|---|
id | The id of the project |
Get all the profiles from the database.
GET http://localhost:3000/api/profiles
Create a profile based on the data provided in the request and save it in the database.
POST http://localhost:3000/api/profiles
Get a profile based on the id provided in the request url
GET http://localhost:3000/api/profiles/id
Parameters | Description |
---|---|
id | The id of the profile |
Update a profile based on the id provided in the request url and the data provided in the request.Get a profile based on the id provided in the request url
PUT http://localhost:3000/api/profiles/id
Parameters | Description |
---|---|
id | The id of the profile |
Delete a profile based on the id provided in the request.
DELETE http://localhost:3000/api/profiles/id
Parameters | Description |
---|---|
id | The id of the profile |
Get all the semesters from the database.
GET http://localhost:3000/api/semesters
Create a semester based on the data provided in the request and save it in the database.
POST http://localhost:3000/api/semesters
Get a semester based on the id provided in the request url
GET http://localhost:3000/api/semesters/id
Parameters | Description |
---|---|
id | The id of the semester |
Update a semester based on the id provided in the request url and the data provided in the request.Get a semester based on the id provided in the request url
PUT http://localhost:3000/api/semesters/id
Parameters | Description |
---|---|
id | The id of the semester |
Delete a semester based on the id provided in the request.
DELETE http://localhost:3000/api/semesters/id
Parameters | Description |
---|---|
id | The id of the semester |
Get the semesters connected to the profile based on the profile id provided in the request url.
GET http://localhost:3000/api/profilesemesters/id
Parameters | Description |
---|---|
id | The id of the profile |
Upload an image using a multipart form
POST http://localhost:3000/upload