This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "country":"BA", | |
| "region":"bih", | |
| "city":"sarajevo", | |
| "cityLatLong":"43.856259,18.413076", | |
| "userIP":"0.0.0.0", | |
| "cityData":[ | |
| { | |
| "city":"Sarajevo", | |
| "city_ascii":"Sarajevo", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const cors = require('cors') | |
| const cityTimezones = require('city-timezones'); | |
| // Set `useWhitelist` to `false` if you want to accept all requests. | |
| const config = { | |
| useWhitelist: false | |
| } | |
| // Define from which origins requests are allowed. | |
| const whitelist = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "gfc-geolocation", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| "cors": "^2.8.4", | |
| "city-timezones": "^1.0.5" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const cors = require('cors') | |
| // Set `useWhitelist` to `false` if you want to accept all requests. | |
| const config = { | |
| useWhitelist: true | |
| } | |
| // Define from which origins requests are allowed. | |
| const whitelist = [ | |
| // 'https://fiddle.jshell.net', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "country":"BA", | |
| "region":"bih", | |
| "city":"sarajevo", | |
| "cityLatLong":"43.856259,18.413076", | |
| "userIP":"0.0.0.0" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "gfc-geolocation", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| "cors": "^2.8.4" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const cors = require('cors') | |
| function _geolocation(req, res) { | |
| const data = { | |
| country: req.headers["x-appengine-country"], | |
| region: req.headers["x-appengine-region"], | |
| city: req.headers["x-appengine-city"], | |
| cityLatLong: req.headers["x-appengine-citylatlong"], | |
| userIP: req.headers["x-appengine-user-ip"] | |
| } |