Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from udacity/ods94065/update-location
Browse files Browse the repository at this point in the history
<fix> update to work with geoip2 0.3.0.0
  • Loading branch information
ods94065 authored Nov 7, 2017
2 parents 45725d0 + 2e03065 commit 4618eb4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Emacs droppings
*~

# Cabal sandbox should not be committed
.cabal-sandbox/
cabal.sandbox.config

# Build output
dist/

# The default geoip database--you should always fetch this yourself instead of
# it being checked in
GeoLite2-City.mmdb
4 changes: 2 additions & 2 deletions Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ instance ToJSON Result where
, "continent" .= geoContinent x
, "countryCode" .= geoCountryISO x
, "countryName" .= geoCountry x
, "latitude" .= (fst <$> geoLocation x)
, "longitude" .= (snd <$> geoLocation x)
, "latitude" .= (locationLatitude <$> geoLocation x)
, "longitude" .= (locationLongitude <$> geoLocation x)
, "postalCode" .= geoPostalCode x
, "region" .= (fst <$> (listToMaybe $ geoSubdivisions x))
, "regionName" .= (snd <$> (listToMaybe $ geoSubdivisions x))
Expand Down
15 changes: 12 additions & 3 deletions geode.cabal
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: geode
version: 0.1.0.0
synopsis: Udacity's GeoIP location service
description:
Geode is a simple web service that returns geographical information about an IP using MaxMind's GeoIP2 City database.
.
Geode can look up a specific IP or the IP associated with the request. In the latter case, it honors Berlioz's
X-Forwarded-For header if present.
.
See the readme in the Git repository for more details.
homepage: https://github.com/udacity/geode
version: 0.1.0.1
license: ISC
license-file: LICENSE
author: James Earl Douglas
maintainer: james.douglas@udacity.com
maintainer: owen@udacity.com
category: Web
build-type: Simple
cabal-version: >=1.10
Expand All @@ -15,7 +24,7 @@ executable geode
build-depends: base
, scotty
, aeson
, geoip2
, geoip2 >= 0.3.0.0
, iproute
, http-types
, text
Expand Down

0 comments on commit 4618eb4

Please sign in to comment.