Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1.12 KB

README.md

File metadata and controls

20 lines (13 loc) · 1.12 KB

Vercel SQLite ip2location demo

Photo by Elena Mozhvilo on Unsplash

Wait for the fetch('api/country') to show where you come from.

How to test

  • fork or clone this repository and go into its folder
  • download IPV4 CSV
  • copy the unzipped IP2LOCATION-LITE-DB1.CSV file into the folder
  • create an sqlite directory (mkdir -p sqlite) and run sqlite3 sqlite/ip2location.ipv4
  • copy and paste ip2location.ipv4.sql content in the SQLite shell
  • run npx vercel --prod to deploy

Please Note

While having a static, read-only, SQLite database on vercel could be handy in various situations, you cannot upload more than 100MB as deploy/build size in there, so be aware this technique might not scale.