A full stack web app for coders of all times to save their coding online resources!
Verb | URI Pattern | Controller#Action |
---|---|---|
POST | /sign-up |
users#signup |
POST | /sign-in |
users#signin |
PATCH | /change-password/:id |
users#changepw |
DELETE | /sign-out/:id |
users#signout |
POST | /resources |
resources#create |
GET | /resources |
resources#index |
PATCH | /resources/:id |
resources#update |
DELETE | /resources/:id |
resources#destroy |
Requests:
curl "${API}${URL_PATH}" \
--include \
--request POST \
--header "Authorization: Token token=$TOKEN" \
--header "Content-Type: application/json" \
--data '{
"resource": {
"name": "'"${NAME}"'",
"url": "'"${URL}"'",
"tag": "'"${TAG}"'",
"content_type": "'"${CONTENT_TYPE}"'"
}
}'
Request:
API="${API_ORIGIN:-http://localhost:4741}"
URL_PATH="/resources"
curl "${API}${URL_PATH}" \
--include \
--request GET \
--header "Authorization: Token token=$TOKEN"
Request:
curl "${API}${URL_PATH}" \
--include \
--request PATCH \
--header "Authorization: Token token=$TOKEN" \
--header "Content-Type: application/json" \
--data '{
"resource": {
"name": "'"${NAME}"'",
"url": "'"${URL}"'"
}
}'
Request:
curl "${API}${URL_PATH}" \
--include \
--request DELETE \
--header "Authorization: Token token=$TOKEN"
I developed this API step by step and use sh to run every script I was creating to see the error and then work on the error I was given. I chose not to scaffold in order to understand the process and to have a methodical organized API development.