Skip to content

Commit

Permalink
Docs and deleted .status("...") (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewZMSU authored Sep 2, 2024
1 parent c6225c0 commit 7b48612
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ parameter. The content type of request should be:
```http request
Content-Type: application/javascript
```

Simple example request body of goto:
```js
async function action(page, request) {
Expand Down
4 changes: 2 additions & 2 deletions routes/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ router.post('/', async function (req, res, next) {

//TODO better request error handling
// if (!("action" in req.body)) {
// res.status("400");
// res.status(400);
// res.send("No action in request")
// }

Expand All @@ -30,7 +30,7 @@ router.post('/', async function (req, res, next) {

//check action function exists
if (!(typeof action === "function" && action.length >= 1)) {
res.status("400");
res.status(400);
res.send("Valid action function: \"async function action(page, request) " +
"{ ... some actions with request and page in puppeteer " +
"syntax};\"");
Expand Down
2 changes: 1 addition & 1 deletion routes/click.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.post('/', async function (req, res, next) {

//TODO better request error handling
if (!("selector" in req.body)) {
res.status("400");
res.status(400);
res.send("No selector to click in request");
next();
return;
Expand Down
4 changes: 2 additions & 2 deletions routes/recaptcha_solver.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ router.post('/', async function (req, res, next) {
}

if (!process.env.TOKEN_2CAPTCHA) {
res.status("501");
res.status(501);
res.send("TOKEN_2CAPTCHA is not provided!");
next();
return;
}

if (!("solve_recaptcha" in req.body)) {
res.status("400");
res.status(400);
res.send("No solve_recaptcha parameter in request");
next();
return;
Expand Down

0 comments on commit 7b48612

Please sign in to comment.