test geo api
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { ipAddress } from "@vercel/functions";
|
||||
|
||||
import { getIpInfo } from "@/lib/utils";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
try {
|
||||
const data = getIpInfo(req);
|
||||
const ip = ipAddress(req);
|
||||
|
||||
return Response.json({
|
||||
ip,
|
||||
city: data.city,
|
||||
region: data.region,
|
||||
country: data.country,
|
||||
latitude: data.latitude,
|
||||
longitude: data.longitude,
|
||||
flag: data.flag,
|
||||
lang: data.lang,
|
||||
device: data.device,
|
||||
browser: data.browser,
|
||||
});
|
||||
} catch (error) {
|
||||
return Response.json({ statusText: "Server error" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,7 @@ export default function SendsEmailList({
|
||||
setCurrentPage={setCurrentPage}
|
||||
pageSize={pageSize}
|
||||
setPageSize={setPageSize}
|
||||
layout="split"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user