express get current url
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}.`));
Also in PHP:
- debug php with print
- Hie date format php
- date formate with timestamp php
- advantages of php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20480 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 64
- Illuminate\Contracts\Container\BindingResolutionException Target class [HomeController] does not exist.
- 6 digit alphanumeric random code generator php
- datephp
- Class 'PHPUnit_Framework_TestCase' not found in vendor
- boucle for php with data
- doctrine where
- check if someone right click javascript
- date format php sql
- check in string is part oof other string php
- ADD OR ON SWITCH CASE PHP
- date to string php
- /laravel-2020-07-27.log" could not be opened
- create new projec in laravel
- display the date and time in php
- find array duplicates in two arrays php
- enable errors in php
- add brackets to string php
- file to base64
- check if a word is present inside a string in php