mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
14 lines
470 B
TypeScript
14 lines
470 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next';
|
|
|
|
export default async function ip(req: NextApiRequest, res: NextApiResponse){
|
|
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,
|
|
region: region
|
|
});
|
|
}
|