Answers for "how to get base url in node js"

6

js get base url

var url = window.location.origin;
Posted by: Guest on August-26-2020
-1

how to get url node

const https = require("https"); //First require the module 

const url = https://url.com 
//good practice is to assign the url to a const named url//

app.get("/", function(req, res){
    https.get(url, function(res){
        console.log(res);//if you wish to console log the respone from the server
    });
Posted by: Guest on April-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language