feat: implement core platform features including business directory, admin dashboard, authentication, and API infrastructure
Some checks failed
Build and Push App / build (push) Failing after 16m2s
Some checks failed
Build and Push App / build (push) Failing after 16m2s
This commit is contained in:
22
scratch/test-geoip.ts
Normal file
22
scratch/test-geoip.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Run with npx ts-node scratch/test-geoip.ts
|
||||
import { getGeoInfo } from '../lib/geo';
|
||||
|
||||
async function test() {
|
||||
const testIps = [
|
||||
'8.8.8.8', // Google (US)
|
||||
'41.207.160.0', // Orange (CI)
|
||||
'1.1.1.1', // Cloudflare (AU/US)
|
||||
'102.64.170.0', // Maroc Telecom (MA)
|
||||
'127.0.0.1' // Local
|
||||
];
|
||||
|
||||
console.log('Testing GeoIP Detection...\n');
|
||||
|
||||
for (const ip of testIps) {
|
||||
const mockHeaders = new Headers();
|
||||
const result = await getGeoInfo(ip, mockHeaders);
|
||||
console.log(`IP: ${ip.padEnd(15)} => Country: ${result.country.padEnd(20)} City: ${result.city}`);
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
Reference in New Issue
Block a user