diff --git a/1.2-BACKEND-APIs.md b/1.2-BACKEND-APIs.md new file mode 100644 index 0000000..72af4e2 --- /dev/null +++ b/1.2-BACKEND-APIs.md @@ -0,0 +1,48 @@ +# BACKEND-APIs + +--- + +> [!TIP] +> `-k` in CURL allows for self-signed certificates. + +## Register + +```shell +curl -k -X POST https://localhost:8080/api/auth/register -H "Content-Type: application/json" -d '{ + "email": "testHDFS@example.com", + "password": "Pass@123", + "username": "testHDFS3", + "firstname": "Test", + "lastname": "HDFS", + "fullname": "Test HDFS" +}' +``` + +## Login + +```shell +curl -k -X POST https://localhost:8080/api/auth/login \ + -H "Content-Type: application/json" \ + -d '{ + "email": "testHDFS@example.com", + "password": "Pass@123" + }' +``` + +## File upload + +```shell +curl -k -X POST https://localhost:8080/api/files/upload \ + -H "Authorization: Bearer $JWT" \ + -F "file=@/home/overnion/Desktop/Typing Speed/15-102-98.mp4" +``` + +## File download + +```shell +curl -k -X GET "https://localhost:8080/api/files/download/15-102-98.mp4?password=Pass@123" \ + -H "Authorization: Bearer $JWT" \ + --output 15-102-98.mp4 +``` + +--- diff --git a/Home.md b/Home.md index 5f2110c..9e82a64 100644 --- a/Home.md +++ b/Home.md @@ -5,3 +5,4 @@ Welcome to the Wiki. --- ## [1.1-TODO](1.1-TODO.md) +## [1.2-BACKEND-APIs](1.2-BACKEND-APIs.md)