@@ -19,6 +19,12 @@ const module = {
19
19
} ) ,
20
20
} ,
21
21
} ,
22
+ /**
23
+ * Handles a request and sends a greeting response.
24
+ * @param {Object } req - The request object containing query parameters.
25
+ * @param {Object } res - The response object used to send the HTTP response.
26
+ * @returns {Object } The response object with a 200 status code and a greeting message.
27
+ */
22
28
handler : ( req , res ) => {
23
29
return res . status ( 200 ) . send ( { hello : req . query . name } ) ;
24
30
} ,
@@ -36,6 +42,12 @@ const module = {
36
42
} ) ,
37
43
} ,
38
44
} ,
45
+ /**
46
+ * Handles HTTP requests and responds with a greeting
47
+ * @param {Object } req - The request object containing method, path, and params
48
+ * @param {Object } res - The response object used to send the HTTP response
49
+ * @returns {Object } JSON object containing a greeting with the name from the request parameters
50
+ */
39
51
handler : ( req , res ) => {
40
52
req . log . debug ( `Request ${ req . method . toUpperCase ( ) } ${ req . path } ` ) ;
41
53
@@ -55,6 +67,14 @@ const module = {
55
67
} ) ,
56
68
} ,
57
69
} ,
70
+ `` `
71
+ /**
72
+ * Handles an HTTP request and responds with a greeting
73
+ * @param {Object} req - The request object containing information about the HTTP request
74
+ * @param {Object} res - The response object used to send the HTTP response
75
+ * @returns {Object} The response object with a 201 status code and a greeting message
76
+ */
77
+ ` ``
58
78
handler : ( req , res ) = > {
59
79
req . log . debug ( `Request ${ req . method . toUpperCase ( ) } ${ req . path } ` ) ;
60
80
@@ -77,6 +97,12 @@ const module = {
77
97
} ) ,
78
98
} ,
79
99
} ,
100
+ /**
101
+ * Handles a request and responds with a customized greeting and comment
102
+ * @param {Object } req - The request object containing method, path, params, and body
103
+ * @param {Object } res - The response object used to send the result
104
+ * @returns {Object } The response object with status 200 and a JSON payload containing a greeting and comment
105
+ */
80
106
handler : ( req , res ) => {
81
107
req . log . debug ( `Request ${ req . method . toUpperCase ( ) } ${ req . path } ` ) ;
82
108
@@ -101,6 +127,12 @@ const module = {
101
127
} ) ,
102
128
} ,
103
129
} ,
130
+ /**
131
+ * Handles HTTP requests and responds with a farewell message
132
+ * @param {Object } req - The request object containing method, path, and params
133
+ * @param {Object } res - The response object used to send the result
134
+ * @returns {Object } The response object with status 200 and a farewell message
135
+ */
104
136
handler : ( req , res ) => {
105
137
req . log . debug ( `Request ${ req . method . toUpperCase ( ) } ${ req . path } ` ) ;
106
138
0 commit comments