I am stuck i have an html form field where users can input a url to scrape. After submitting the form i want to get the value in the form controller in laravel and send to node js to scrape the url.
My code is this:
controller:
class welcomechecker extends Controller
{
function getfrontpage(){
return view('welcome');
}
function saveformdata(Request $request){
$url = $request->input('enter_url');
$data=array('website'=>$url,"cms"=>$url,"plugin"=>$url);
DB::table('checkplugin')->insert($data);
// return $request->input();
}
}
node js file which is in node/file.js in root directory of laravel installation:
var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
//Scraping start
app.get('/scrape', function(req, res){
}
Any help on how to send form value to the file.js from php laravel controller or any other method will be welcomed