import type { NextApiRequest, NextApiResponse } from 'next'

export default function handler(
    req: NextApiRequest,
    res: NextApiResponse
  ) {
    const getClientAddress = function (req) {
      return (req.headers['x-forwarded-for'] || '').split(',')[0] 
      || req.connection.remoteAddress;
    };
    console.log(getClientAddress);
  }
  