Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
NodeJS Check if the URL was updated

I'm using NodeJS (v. 17.8.0) and am using express.js to host my project. My goal is to pass something through the URL, take that something in NodeJS, and send it over a TCP connection. I've been able to update the URL over Vanilla JS but am having issues with the node-url module. 

Code thats updating the url:

    let newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + 'para=' + id;
    window.history.pushState({path:newurl},'',newurl);

NodeJS code:

let express  = require('express');
let app = express();
let bodyParser = require('body-parser');

let url = require("url");
let net = require('net');

const path = require('path');



app.use(bodyParser.json());
app.use(express.static('public'));

    app.listen(3000, function(){
        console.log("Server started on port: 3000");
    })

    app.get('', (req, res) => {
        console.log(req.protocol)    
        console.log(req.hostname)     
        console.log(req.path)         
        console.log(req.originalUrl)  
        console.log(req.subdomains)   
      })
      
   

What would be the best way to achieve that?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda