diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-11-05 23:49:32 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-11-05 23:49:32 +0100 |
| commit | 5e5f92af830dc4c39de4420ac8effebb3bdd392e (patch) | |
| tree | 2f96f49dba80aed08983df02f6cce8f1e115462f /lib/okgeo/index.js | |
| parent | dc5e6ed69b9628310f66f89336f4707a0e42ef66 (diff) | |
geo service
Diffstat (limited to 'lib/okgeo/index.js')
| -rw-r--r-- | lib/okgeo/index.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/okgeo/index.js b/lib/okgeo/index.js new file mode 100644 index 00000000..20122ffb --- /dev/null +++ b/lib/okgeo/index.js @@ -0,0 +1,30 @@ + +/** + * This service dumps the headers in hopes the country code will be there. + */ + +function OKGeo (options) { + if (!(this instanceof OKGeo)) return new OKGeo(options) + options = options || {} + if (!options.express) + throw new Error('Express not provided to OKGeo'); + if (!options.config) + throw new Error('Configuration not provided to OKGeo'); + + var express = options.express + var router = express.Router() + var config = options.config + var db = options.db + + router.get('*', function (req, res) { + res.send(req.headers) + }) + + this._router = router +} + +OKGeo.prototype.middleware = function () { + return this._router +} + +module.exports = OKGeo |
