mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
14 lines
No EOL
446 B
TypeScript
14 lines
No EOL
446 B
TypeScript
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'];
|
|
res.status(200).json({
|
|
ip: ip,
|
|
continent: continent,
|
|
country: country,
|
|
city: city
|
|
});
|
|
} |