rhyuen / iptracker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tracking for Personal Sites

I wanted to see if the CORS worked better on the vercel apis. So I tried the sample code here.

January 16, 2020

Put a file named 404.html in /public/404.html for an automatic 404 not found!

January 16, 2020

req.url for the path of the domain Source. req.headers.host for the domain. Source.

export default function handler(req, res){
    console.log(req.headers.host); //returns the hostname eg: https://hostname.ca/path/to/path
    console.log(req.url); //returns the stuff after the hostname eg: https://hostname.ca/allofthetext/here/including/the/first/dash/afterthe/hostname
}

About


Languages

Language:JavaScript 98.4%Language:HTML 1.6%