Commit 73b939bb authored by RusiraPathum's avatar RusiraPathum

final2

parent 14f385dd
...@@ -24,25 +24,22 @@ docker-compose up -d aplos ...@@ -24,25 +24,22 @@ docker-compose up -d aplos
docker-compose up -d gateway docker-compose up -d gateway
docker-compose up -d web docker-compose up -d web
``` ```
** After hosting website, it can be reached on `<Ip address of the Vm>:4300`. ** After hosting website, it can be reached on `<Ip address of the Vm>:4600`.
#### 1. add student details #### 1. add student details
``` ```
# request # request
axios curl -XPOST "http://localhost:7654/api/students" \
.post("http://localhost:8070/student/add", newStudent) --header "Content-Type: application/json" \
.then(() => { --header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
alert("Student Added"); --data '
{
document.getElementById('name').value = "Pathum"; "studentId": "54",
document.getElementById('age').value = "23"; "name": "Pathum",
document.getElementById('gender').value = "Male"; "age": "23",
"gender": "Male"
}) }
.catch((err) => {
alert(err);
});
' '
# reply # reply
...@@ -54,15 +51,13 @@ axios ...@@ -54,15 +51,13 @@ axios
``` ```
# request # request
axois curl -XPOST "http://localhost:7654/api/students" \
.get("http://localhost:8070/student/") --header "Content-Type: application/json" \
.then((res) => { --header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
setStudents(res.data); --data '
// console.log(res); {
}) "studentId": "54"
.catch((err) => { }
alert(err.message);
});
' '
# reply # reply
...@@ -73,25 +68,16 @@ axois ...@@ -73,25 +68,16 @@ axois
``` ```
# request # request
axios curl -XPOST "http://localhost:7654/api/students" \
.get(`http://localhost:8070/student/get/` + sid) --header "Content-Type: application/json" \
.then((res) => { --header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
setStudents(res.data); --data '
studentId1 = res.data._id; {
name1 = res.data.name; "studentId": "54",
age1 = res.data.age; "name": "Sandeepa",
gender1 = res.data.gender; "age": "24",
"gender": "Male"
// console.log(age1); }
document.getElementById("studentId").valu studentId1;
document.getElementById("name").value = name1;
document.getElementById("age").value = age1;
ocument.getElementById("gender").value = gender1;
})
.catch((err) => {
alert(err.message);
});
' '
# reply # reply
...@@ -103,20 +89,15 @@ axios ...@@ -103,20 +89,15 @@ axios
``` ```
# request # request
axois curl -XPOST "http://localhost:7654/api/students" \
.delete(`http://localhost:8070/student${id}`) --header "Content-Type: application/json" \
.then(() => { --header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
alert("Successfully Deleted"); --data '
window.location.reload(); {
}) "studentId": "54",
.catch((err) => { }
alert(err.message);
});
onClose();
' '
# reply # reply
{"name":"Sandeepa","age":"24","gender": "male"}
{"code":200,"msg":"Successfully Deleted Student Details"} {"code":200,"msg":"Successfully Deleted Student Details"}
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment