Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
How to get the details on backend nodejs with the GET request in angular

I am unable to fetch the query parameters of frontend GET request, on the backend side. I tried using url and query. I need to fetch the query on the nodejs side. Kindly suggest a suitable method that would help me get the details on GET request using axios.

code -

component.ts - angular file

googleSearch(googleText){


let params = new HttpParams();
    params = params.append('q', googleText.trueLocation);
       

return new Promise((resolve, reject) => {
this.httpClient.get("http://localhost:3003/seekSearchApi" , ({params:params}))
      .pipe(map(Response => Response))
    
      .pipe(catchError(this.errorHandler))
      .subscribe((res: Response) => {

        this.writeItOutput = res;
        
        resolve(this.writeItOutput);

      });

    })
    
  

}
errorHandler(error: HttpErrorResponse) {
  return throwError(error.message || 'server Error');
}
}

server.js- express file

app.use('/seekSearchApi', require('./server/nodejs-serverapi'));

applicationserver.js - nodejs file

function seekSearchApi(req,res) { 

var query = require('url').parse(req.url,true).query;

console.log("req.query.q", query.q);  //no response

console.log("Inside seekSearchApi");

  axios({
    method: 'get',
    url: 'https://serpapi.com/search.json?',
    data: {
      api_key: "xxxx",
      q:query.q
      hl: "en",
      gl: "us",
      google_domain: "google.com"
    }
  }).then((response) => {
    res.send(stringify(response))
   
  }, (error) => {
    console.log(error);
  });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I figured it out .

On node side.

applicationserver.js

function seekSearchApi(req,res) { 

var url_data = url.parse(req.url, true);
var query = url_data.query;
var queryData= Object.assign({},query);
console.log("queryData = ", queryData);

  ::::
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda