mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
ip api test
This commit is contained in:
parent
e629ce7d22
commit
af549fa168
2 changed files with 10 additions and 4 deletions
6
pages/api/ip.ts
Normal file
6
pages/api/ip.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
export default async function ip(req: NextApiRequest, res: NextApiResponse){
|
||||
const ip = (req.headers['x-forwarded-for' || 'x-vercel-forwarded-for']);
|
||||
res.json({ ip: ip });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue