Skip to content

Commit

Permalink
test route added
Browse files Browse the repository at this point in the history
  • Loading branch information
patheticGeek committed Apr 1, 2020
1 parent 83f4b58 commit d6bf45d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
]
},
"prettier": {
"printWidth": 120
"printWidth": 140
},
"dependencies": {
"axios": "^0.19.0",
Expand Down
13 changes: 13 additions & 0 deletions routes/search.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
const express = require("express");
const puppeteer = require("puppeteer");

const piratebaySearch = require("../crawllers/piratebay/search");
const o337xSearch = require("../crawllers/1337x/search");
const limetorrentSearch = require("../crawllers/limetorrent/search");

const router = express.Router();

router.get("/test", async (req, res) => {
try {
const browser = await puppeteer.launch();

await browser.close();
res.send({ error: false });
} catch (e) {
console.log("Puppeteer error");
res.json({ error: true, errorMessage: e.message });
}
});

router.get("/piratebay", async (req, res) => {
let query = req.query.query;

Expand Down

0 comments on commit d6bf45d

Please sign in to comment.