mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Update ip.ts
Signed-off-by: skidoodle <contact@albert.lol>
This commit is contained in:
parent
c66491ed96
commit
f79c1e8e2d
1 changed files with 6 additions and 6 deletions
|
@ -1,14 +1,14 @@
|
|||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
export default async function ip(req: NextApiRequest, res: NextApiResponse){
|
||||
let ip = req.headers['cf-connecting-ip'];
|
||||
let continent = req.headers['cf-ipcontinent'];
|
||||
let country = req.headers['cf-ipcountry'];
|
||||
let city = req.headers['cf-ipcity'];
|
||||
let ip = req.headers['x-vercel-forwarded-for'];
|
||||
let region = req.headers['x-vercel-ip-country-region'];
|
||||
let country = req.headers['x-vercel-ip-country'];
|
||||
let city = req.headers['x-vercel-ip-city'];
|
||||
res.status(200).json({
|
||||
ip: ip,
|
||||
city: city,
|
||||
country: country,
|
||||
continent: continent
|
||||
region: region
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue