Changes for mentioning db path... (#857)
This commit is contained in:
parent
b5c733df47
commit
1ba76d72f0
|
@ -13,7 +13,7 @@ public class RawDBDemoGeoIPLocationService{
|
|||
private DatabaseReader dbReader;
|
||||
|
||||
public RawDBDemoGeoIPLocationService() throws IOException {
|
||||
File database = new File("C:\\Users\\Parth Joshi\\Desktop\\GeoLite2-City.mmdb\\GeoLite2-City.mmdb");
|
||||
File database = new File("your-path-to-db-file");
|
||||
dbReader = new DatabaseReader.Builder(database).build();
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
<div id="status"></div>
|
||||
|
||||
<div id="map" style="height: 500px; width:100%; position:absolute"></div>
|
||||
<!--AIzaSyDDr65sVtJtlbliOTAeXyZSDPvG9NROjJA -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA4vsDQWHeOrDnzS98XMXl5hgwA9raaQZ8"
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR-MAPS-API-KEY"
|
||||
async defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -15,10 +15,10 @@ public class GeoIpIntegrationTest {
|
|||
|
||||
@Test
|
||||
public void givenIP_whenFetchingCity_thenReturnsCityData() throws IOException, GeoIp2Exception {
|
||||
File database = new File("C:\\Users\\Parth Joshi\\Desktop\\GeoLite2-City.mmdb\\GeoLite2-City.mmdb");
|
||||
File database = new File("your-path-to-db-file");
|
||||
DatabaseReader dbReader = new DatabaseReader.Builder(database).build();
|
||||
|
||||
InetAddress ipAddress = InetAddress.getByName("202.47.112.9");
|
||||
InetAddress ipAddress = InetAddress.getByName("your-public-ip");
|
||||
CityResponse response = dbReader.city(ipAddress);
|
||||
|
||||
String countryName = response.getCountry().getName();
|
||||
|
|
Loading…
Reference in New Issue