Skip to content

Commit

Permalink
Patched /tmp/tmpptoa8sbv/custom/src/modules/hello/v1/module.js
Browse files Browse the repository at this point in the history
  • Loading branch information
patched.codes[bot] committed Sep 2, 2024
1 parent 43218ee commit 7e5b5ba
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions custom/src/modules/hello/v1/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const module = {
}),
},
},
/**
* Handles a request and sends a greeting response.
* @param {Object} req - The request object containing query parameters.
* @param {Object} res - The response object used to send the HTTP response.
* @returns {Object} The response object with a 200 status code and a greeting message.
*/
handler: (req, res) => {
return res.status(200).send({ hello: req.query.name });
},
Expand All @@ -36,6 +42,12 @@ const module = {
}),
},
},
/**
* Handles HTTP requests and responds with a greeting
* @param {Object} req - The request object containing method, path, and params
* @param {Object} res - The response object used to send the HTTP response
* @returns {Object} JSON object containing a greeting with the name from the request parameters
*/
handler: (req, res) => {
req.log.debug(`Request ${req.method.toUpperCase()} ${req.path}`);

Expand All @@ -55,6 +67,14 @@ const module = {
}),
},
},
```
/**
* Handles an HTTP request and responds with a greeting
* @param {Object} req - The request object containing information about the HTTP request
* @param {Object} res - The response object used to send the HTTP response
* @returns {Object} The response object with a 201 status code and a greeting message
*/
```
handler: (req, res) => {
req.log.debug(`Request ${req.method.toUpperCase()} ${req.path}`);

Expand All @@ -77,6 +97,12 @@ const module = {
}),
},
},
/**
* Handles a request and responds with a customized greeting and comment
* @param {Object} req - The request object containing method, path, params, and body
* @param {Object} res - The response object used to send the result
* @returns {Object} The response object with status 200 and a JSON payload containing a greeting and comment
*/
handler: (req, res) => {
req.log.debug(`Request ${req.method.toUpperCase()} ${req.path}`);

Expand All @@ -101,6 +127,12 @@ const module = {
}),
},
},
/**
* Handles HTTP requests and responds with a farewell message
* @param {Object} req - The request object containing method, path, and params
* @param {Object} res - The response object used to send the result
* @returns {Object} The response object with status 200 and a farewell message
*/
handler: (req, res) => {
req.log.debug(`Request ${req.method.toUpperCase()} ${req.path}`);

Expand Down

0 comments on commit 7e5b5ba

Please sign in to comment.