express get current url

PHP
var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascript$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;  const url = require('url');
const express = require('express');

const app = express();
app.use((req, res, next) => {
  const path = url.parse(req.url).path;
  // Do something...
});

const port = 3000;
app.listen(port, console.log(`Listening on port ${port}.`));
Source

Also in PHP: