diff --git a/Programming_Languages/NodeJS/Middlewear.md b/Programming_Languages/NodeJS/Middlewear.md index 1f3276c..b74dc44 100644 --- a/Programming_Languages/NodeJS/Middlewear.md +++ b/Programming_Languages/NodeJS/Middlewear.md @@ -72,3 +72,22 @@ We can expose this to express with `app.use(static('public'))`. Then if we navig > `app.use(express.urlencoded())` Generally we handle the data of API requests via a JSON body and the `express.json()` middlewear. However, in cases where the data is sent from the client in the form of `key=value&key=value` appendages to the request URL, `urlencoded` allows us to parse them. + + +## Third-party middlewear +### Helmet + +Helmet is middlewear that makes it easier to set HTTP headers. + +### Morgan + +Morgan is middlewear that is used to log HTTP requests to the Express instance. +```js +app.use(morgan('dev')) +``` +With Morgan in place, every time we run a request it will be logged on the console that is running our Node application, e.g: + +```plain +GET /api/courses 200 95 - 1.774 ms + +``` \ No newline at end of file diff --git a/pdf/Algorithmic_complexity.pdf b/pdf/Algorithmic_complexity.pdf index aee7521..e620d6d 100644 Binary files a/pdf/Algorithmic_complexity.pdf and b/pdf/Algorithmic_complexity.pdf differ diff --git a/pdf/Arrays.pdf b/pdf/Arrays.pdf index bf612d9..d75bf9c 100644 Binary files a/pdf/Arrays.pdf and b/pdf/Arrays.pdf differ diff --git a/pdf/Assembly_programs.pdf b/pdf/Assembly_programs.pdf index f3da181..01f9b63 100644 Binary files a/pdf/Assembly_programs.pdf and b/pdf/Assembly_programs.pdf differ diff --git a/pdf/Atomic_and_molecular_sentences.pdf b/pdf/Atomic_and_molecular_sentences.pdf index 3dc7b72..0378854 100644 Binary files a/pdf/Atomic_and_molecular_sentences.pdf and b/pdf/Atomic_and_molecular_sentences.pdf differ diff --git a/pdf/Axioms_of_set_theory.pdf b/pdf/Axioms_of_set_theory.pdf index 4cd7638..3f34ec4 100644 Binary files a/pdf/Axioms_of_set_theory.pdf and b/pdf/Axioms_of_set_theory.pdf differ diff --git a/pdf/Basic_database_concepts.pdf b/pdf/Basic_database_concepts.pdf index 9cc2329..c64ab95 100644 Binary files a/pdf/Basic_database_concepts.pdf and b/pdf/Basic_database_concepts.pdf differ diff --git a/pdf/Basic_properties_of_sets.pdf b/pdf/Basic_properties_of_sets.pdf index ecd735e..6730f18 100644 Binary files a/pdf/Basic_properties_of_sets.pdf and b/pdf/Basic_properties_of_sets.pdf differ diff --git a/pdf/Biconditional_Elimination.pdf b/pdf/Biconditional_Elimination.pdf index 0b4d817..655cbb9 100644 Binary files a/pdf/Biconditional_Elimination.pdf and b/pdf/Biconditional_Elimination.pdf differ diff --git a/pdf/Biconditional_Introduction.pdf b/pdf/Biconditional_Introduction.pdf index dd7b27d..3e3459a 100644 Binary files a/pdf/Biconditional_Introduction.pdf and b/pdf/Biconditional_Introduction.pdf differ diff --git a/pdf/Binary_arithmetic.pdf b/pdf/Binary_arithmetic.pdf index 91649ff..b275ee1 100644 Binary files a/pdf/Binary_arithmetic.pdf and b/pdf/Binary_arithmetic.pdf differ diff --git a/pdf/Binary_arithmetic_with_circuits.pdf b/pdf/Binary_arithmetic_with_circuits.pdf index 2cea8ff..2111d98 100644 Binary files a/pdf/Binary_arithmetic_with_circuits.pdf and b/pdf/Binary_arithmetic_with_circuits.pdf differ diff --git a/pdf/Bits,_bytes,_nibbles.pdf b/pdf/Bits,_bytes,_nibbles.pdf index d5e1267..08184b3 100644 Binary files a/pdf/Bits,_bytes,_nibbles.pdf and b/pdf/Bits,_bytes,_nibbles.pdf differ diff --git a/pdf/Compile_from_source.pdf b/pdf/Compile_from_source.pdf index 9532f5d..37ef3a3 100644 Binary files a/pdf/Compile_from_source.pdf and b/pdf/Compile_from_source.pdf differ diff --git a/pdf/Conditional_Elimination.pdf b/pdf/Conditional_Elimination.pdf index 93ce543..e83f1ed 100644 Binary files a/pdf/Conditional_Elimination.pdf and b/pdf/Conditional_Elimination.pdf differ diff --git a/pdf/Conditional_Introduction.pdf b/pdf/Conditional_Introduction.pdf index 7c7c2f5..996602d 100644 Binary files a/pdf/Conditional_Introduction.pdf and b/pdf/Conditional_Introduction.pdf differ diff --git a/pdf/Conjunction_Elimination.pdf b/pdf/Conjunction_Elimination.pdf index 7527d56..160da72 100644 Binary files a/pdf/Conjunction_Elimination.pdf and b/pdf/Conjunction_Elimination.pdf differ diff --git a/pdf/Conjunction_Introduction.pdf b/pdf/Conjunction_Introduction.pdf index bd04922..06f5d88 100644 Binary files a/pdf/Conjunction_Introduction.pdf and b/pdf/Conjunction_Introduction.pdf differ diff --git a/pdf/Defining_a_computer.pdf b/pdf/Defining_a_computer.pdf index c05a567..d3b53d4 100644 Binary files a/pdf/Defining_a_computer.pdf and b/pdf/Defining_a_computer.pdf differ diff --git a/pdf/Design_features_of_language.pdf b/pdf/Design_features_of_language.pdf index 4ee2771..652c587 100644 Binary files a/pdf/Design_features_of_language.pdf and b/pdf/Design_features_of_language.pdf differ diff --git a/pdf/Disjunction_Elimination.pdf b/pdf/Disjunction_Elimination.pdf index 45637e6..82e193e 100644 Binary files a/pdf/Disjunction_Elimination.pdf and b/pdf/Disjunction_Elimination.pdf differ diff --git a/pdf/Disjunction_Introduction.pdf b/pdf/Disjunction_Introduction.pdf index cc50290..4981979 100644 Binary files a/pdf/Disjunction_Introduction.pdf and b/pdf/Disjunction_Introduction.pdf differ diff --git a/pdf/HTTP_request_types.pdf b/pdf/HTTP_request_types.pdf index 499fd1c..d002d6b 100644 Binary files a/pdf/HTTP_request_types.pdf and b/pdf/HTTP_request_types.pdf differ diff --git a/pdf/Indeterminacy.pdf b/pdf/Indeterminacy.pdf index e08892e..6f7077d 100644 Binary files a/pdf/Indeterminacy.pdf and b/pdf/Indeterminacy.pdf differ diff --git a/pdf/Law_of_the_Excluded_Middle.pdf b/pdf/Law_of_the_Excluded_Middle.pdf index ee9af8c..d557a3a 100644 Binary files a/pdf/Law_of_the_Excluded_Middle.pdf and b/pdf/Law_of_the_Excluded_Middle.pdf differ diff --git a/pdf/Logic_circuits.pdf b/pdf/Logic_circuits.pdf index 7f4010d..38b7082 100644 Binary files a/pdf/Logic_circuits.pdf and b/pdf/Logic_circuits.pdf differ diff --git a/pdf/Logic_gates.pdf b/pdf/Logic_gates.pdf index 6d31daa..6312260 100644 Binary files a/pdf/Logic_gates.pdf and b/pdf/Logic_gates.pdf differ diff --git a/pdf/Logical_possibility_and_necessity.pdf b/pdf/Logical_possibility_and_necessity.pdf index 70d683d..403e9f3 100644 Binary files a/pdf/Logical_possibility_and_necessity.pdf and b/pdf/Logical_possibility_and_necessity.pdf differ diff --git a/pdf/Lovelace_quote.pdf b/pdf/Lovelace_quote.pdf index 8ec4377..5c4937f 100644 Binary files a/pdf/Lovelace_quote.pdf and b/pdf/Lovelace_quote.pdf differ diff --git a/pdf/Morphology.pdf b/pdf/Morphology.pdf index 270904b..a7bcb2c 100644 Binary files a/pdf/Morphology.pdf and b/pdf/Morphology.pdf differ diff --git a/pdf/Negation_Elimination.pdf b/pdf/Negation_Elimination.pdf index a44e6de..8b30980 100644 Binary files a/pdf/Negation_Elimination.pdf and b/pdf/Negation_Elimination.pdf differ diff --git a/pdf/Negation_Introduction.pdf b/pdf/Negation_Introduction.pdf index 5c66421..2863acc 100644 Binary files a/pdf/Negation_Introduction.pdf and b/pdf/Negation_Introduction.pdf differ diff --git a/pdf/Object_language_and_meta-language.pdf b/pdf/Object_language_and_meta-language.pdf index f7fc823..756f807 100644 Binary files a/pdf/Object_language_and_meta-language.pdf and b/pdf/Object_language_and_meta-language.pdf differ diff --git a/pdf/Package_management_in_Arch.pdf b/pdf/Package_management_in_Arch.pdf index 623ecce..9780a68 100644 Binary files a/pdf/Package_management_in_Arch.pdf and b/pdf/Package_management_in_Arch.pdf differ diff --git a/pdf/Primary_key.pdf b/pdf/Primary_key.pdf index 9b2f13e..eb94b0b 100644 Binary files a/pdf/Primary_key.pdf and b/pdf/Primary_key.pdf differ diff --git a/pdf/Queue.pdf b/pdf/Queue.pdf index b7092df..c291294 100644 Binary files a/pdf/Queue.pdf and b/pdf/Queue.pdf differ diff --git a/pdf/RESTful_APIs.pdf b/pdf/RESTful_APIs.pdf index 7d4a974..748f98c 100644 Binary files a/pdf/RESTful_APIs.pdf and b/pdf/RESTful_APIs.pdf differ diff --git a/pdf/Recursion.pdf b/pdf/Recursion.pdf index 473d8c0..ac5f07c 100644 Binary files a/pdf/Recursion.pdf and b/pdf/Recursion.pdf differ diff --git a/pdf/Reiteration.pdf b/pdf/Reiteration.pdf index bba31ff..4f38913 100644 Binary files a/pdf/Reiteration.pdf and b/pdf/Reiteration.pdf differ diff --git a/pdf/SQL_syntax.pdf b/pdf/SQL_syntax.pdf index 25c8b36..771a27a 100644 Binary files a/pdf/SQL_syntax.pdf and b/pdf/SQL_syntax.pdf differ diff --git a/pdf/Semantic_versioning.pdf b/pdf/Semantic_versioning.pdf index 42d5239..3b1b085 100644 Binary files a/pdf/Semantic_versioning.pdf and b/pdf/Semantic_versioning.pdf differ diff --git a/pdf/Soundness.pdf b/pdf/Soundness.pdf index c9b2a6a..cd21a14 100644 Binary files a/pdf/Soundness.pdf and b/pdf/Soundness.pdf differ diff --git a/pdf/Stacks.pdf b/pdf/Stacks.pdf index 0f75b6e..e3fde78 100644 Binary files a/pdf/Stacks.pdf and b/pdf/Stacks.pdf differ diff --git a/pdf/Syllogism.pdf b/pdf/Syllogism.pdf index 5ca41a5..a36dfbd 100644 Binary files a/pdf/Syllogism.pdf and b/pdf/Syllogism.pdf differ diff --git a/pdf/The_Pragmatic_Programmer_1999.pdf b/pdf/The_Pragmatic_Programmer_1999.pdf index 29124a7..21274ff 100644 Binary files a/pdf/The_Pragmatic_Programmer_1999.pdf and b/pdf/The_Pragmatic_Programmer_1999.pdf differ diff --git a/pdf/The_binary_number_system.pdf b/pdf/The_binary_number_system.pdf index 7df8e58..0af9345 100644 Binary files a/pdf/The_binary_number_system.pdf and b/pdf/The_binary_number_system.pdf differ diff --git a/pdf/Theorems_and_empty_sets.pdf b/pdf/Theorems_and_empty_sets.pdf index 04eb173..926bcaf 100644 Binary files a/pdf/Theorems_and_empty_sets.pdf and b/pdf/Theorems_and_empty_sets.pdf differ diff --git a/pdf/Turing_machines.pdf b/pdf/Turing_machines.pdf index 1f9ad66..2332cf7 100644 Binary files a/pdf/Turing_machines.pdf and b/pdf/Turing_machines.pdf differ diff --git a/pdf/User_management.pdf b/pdf/User_management.pdf index df39af7..3c89620 100644 Binary files a/pdf/User_management.pdf and b/pdf/User_management.pdf differ diff --git a/pdf/Von_Neumann_architecture.pdf b/pdf/Von_Neumann_architecture.pdf index 4eb2646..20c71b6 100644 Binary files a/pdf/Von_Neumann_architecture.pdf and b/pdf/Von_Neumann_architecture.pdf differ diff --git a/pdf/Why_computers_use_binary.pdf b/pdf/Why_computers_use_binary.pdf index 0f488ac..acccab4 100644 Binary files a/pdf/Why_computers_use_binary.pdf and b/pdf/Why_computers_use_binary.pdf differ