generated from fahricansecer/boilerplate-be
This commit is contained in:
17
test-curl-list.sh
Executable file
17
test-curl-list.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
LOGIN_RES=$(curl -s -X POST http://localhost:3000/api/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"admin@contentgen.ai","password":"Admin123!"}')
|
||||
|
||||
TOKEN=$(echo $LOGIN_RES | grep -o '"accessToken":"[^"]*' | cut -d'"' -f4)
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "Login failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Fetching projects..."
|
||||
curl -s -X GET http://localhost:3000/api/projects \
|
||||
-H "Authorization: Bearer $TOKEN" > list_res.json
|
||||
|
||||
echo "Raw List Response:"
|
||||
cat list_res.json
|
||||
Reference in New Issue
Block a user