Added CURL commands to test basic backend functionality such as login, register, file upload + download.

K
2025-07-04 01:43:34 +05:30
parent 636a026697
commit dc4baabe39
2 changed files with 49 additions and 0 deletions
+48
@@ -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
```
---
+1
@@ -5,3 +5,4 @@ Welcome to the Wiki.
--- ---
## [1.1-TODO](1.1-TODO.md) ## [1.1-TODO](1.1-TODO.md)
## [1.2-BACKEND-APIs](1.2-BACKEND-APIs.md)