Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
NodeJS Comprobar si la URL se actualizó

Estoy usando NodeJS (v. 17.8.0) y estoy usando express.js para alojar mi proyecto. Mi objetivo es pasar algo a través de la URL, tomar ese algo en NodeJS y enviarlo a través de una conexión TCP. Pude actualizar la URL en Vanilla JS, pero tengo problemas con el módulo de URL de nodo.

Código que está actualizando la url:

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

Código NodeJS:

 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) })

¿Cuál sería la mejor manera de lograr eso?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!