mirror of
https://github.com/skidoodle/albert.lol.git
synced 2026-04-28 11:17:41 +02:00
f79c1e8e2d
Signed-off-by: skidoodle <contact@albert.lol>
15 lines
470 B
TypeScript
15 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
|
|
});
|
|
}
|