done server

This commit is contained in:
Kfir Dayan 2023-05-31 14:52:51 +03:00
parent a4109d709e
commit e49b986c8a

View file

@ -20,7 +20,7 @@ public function index()
public function crawlWebsite(Request $request)
{
$url = $request->query('url');
$depth = $request->query('depth', 1);
$depth = $request->query('depth', 0);
$refresh = $request->query('refresh', false);
// Check if the URL is already in the database
@ -122,7 +122,13 @@ protected function getLinksFromPage($crawlerContent)
protected function scan($url)
{
try {
$result = $this->webClient->request('GET', $url);
} catch (\Exception $e) {
return response()->json([
'error' => 'Failed to retrieve the URL',
], 500);
}
return $result;
}