Skip to content

Commit

Permalink
update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
fernargdev committed Feb 29, 2024
1 parent 4eda464 commit 2af40ff
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ This repository contains the answers to the [Full Stack Open version 2024](https
- Validation and ESLint

[See the answers](https://github.com/fernargdev/full-stack-open/tree/main/part_3)

### [Part 4 - Testing Express servers, user administration](https://fullstackopen.com/en/part4)

- Structure of backend application, introduction to testing
- Testing the backend
- User administration
- Token authentication
- Legacy: Testing with Jest

[See the answers](https://github.com/fernargdev/full-stack-open/tree/main/part_4)
11 changes: 11 additions & 0 deletions part_4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Part 4 - Testing Express servers, user administration

In this part, we will continue our work on the backend. Our first major theme will be writing unit and integration tests for the backend. After we have covered testing, we will take a look at implementing user authentication and authorization.

## Modules

a. [Structure of backend application, introduction to testing](https://fullstackopen.com/en/part4/structure_of_backend_application_introduction_to_testing)
b. [Testing the backend](https://fullstackopen.com/en/part4/testing_the_backend)
c. [User administration](https://fullstackopen.com/en/part4/user_administration)
d. [Token authentication](https://fullstackopen.com/en/part4/token_authentication)
e. [Legacy: Testing with Jest](https://fullstackopen.com/en/part4/legacy_testing_with_jest)
2 changes: 1 addition & 1 deletion part_4/bloglist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint .",
"test": "jest --verbose --runInBand",
"test:unit": "jest --verbose --runInBand tests/unit.test.js",
"test:integration": "jest --verbose --runInBand tests/blog_api.test.js",
"test:blogs": "jest --verbose --runInBand tests/blog_api.test.js",
"test:users": "jest --verbose --runInBand tests/users.test.js"
},
"author": "Fernando Angel Rodriguez Gonzalez",
Expand Down
46 changes: 19 additions & 27 deletions part_4/bloglist/requests/requests-local.rest
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
@api=http:https://localhost:3003/api


# ### GET api/authors
# GET {{api}}/authors

# ### POST api/authors
# POST {{api}}/authors
# Content-Type: application/json

# {
# "authorname": "Fernando3",
# "name": "Fernando Rodriguez",
# "password": "Salainen1"
# }


### GET api/blogs
### GET api/blogs ✅
GET {{api}}/blogs

### POST api/blogs
### POST api/blogs
POST {{api}}/blogs
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImhlbGxhcyIsImlkIjoiNjVkZTEyNWIzZjczNDI3YTk5YzI5YjYzIiwiaWF0IjoxNzA5MDUyNTE0fQ.hL4b6GJdScyi5iDw69828RSQlQj2nYAV3opy521kkZQ
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImhlbGxhcyIsImlkIjoiNjVlMGE3MzcxYzUwZjA1YmY4ZjE4MTI0IiwiaWF0IjoxNzA5MjIxNzE0fQ.mb2yz6NpKjd5fPUhLLdogaHeeq5WBgg3DxoVvmnNzM4

{
"url": "https://martinfowler.com",
"title": "Distributed Objects",
"author": "Martin Fowler"
}

### DELETE api/blogs/id
DELETE {{api}}/blogs/65de149f75048ea31fee4dd1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImhlbGxhcyIsImlkIjoiNjVkZTEyNWIzZjczNDI3YTk5YzI5YjYzIiwiaWF0IjoxNzA5MDUyNTE0fQ.hL4b6GJdScyi5iDw69828RSQlQj2nYAV3opy521kkZQ
### DELETE api/blogs/id
DELETE {{api}}/blogs/65e0a7a41c50f05bf8f18131
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImhlbGxhcyIsImlkIjoiNjVlMGE3MzcxYzUwZjA1YmY4ZjE4MTI0IiwiaWF0IjoxNzA5MjIxNzE0fQ.mb2yz6NpKjd5fPUhLLdogaHeeq5WBgg3DxoVvmnNzM4

### PUT api/blogs/id
PUT {{api}}/blogs
### PUT api/blogs/id ✅
PUT {{api}}/blogs/65e0a7f21c50f05bf8f18145
Content-Type: application/json

{
"title": "Domain Specific Languages",
"likes": 12
}


### GET api/users
### GET api/users
GET {{api}}/users

### POST api/users
### POST api/users
POST {{api}}/users
Content-Type: application/json

Expand All @@ -50,11 +42,11 @@ Content-Type: application/json
"password": "Fernando1234"
}

### DELETE api/users
DELETE {{api}}/users/65dae400becabcc5b73d631a
### DELETE api/users
DELETE {{api}}/users/65e0a7031c50f05bf8f1811b


### POST api/login
### POST api/login
POST {{api}}/login
Content-Type: application/json

Expand Down

0 comments on commit 2af40ff

Please sign in to comment.