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

142
Views
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
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!