Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koopjs/koop-provider-gist
Github gist provider for Koop.
https://github.com/koopjs/koop-provider-gist
koop-2 koop-provider needs-update
Last synced: 30 days ago
JSON representation
Github gist provider for Koop.
- Host: GitHub
- URL: https://github.com/koopjs/koop-provider-gist
- Owner: koopjs
- License: other
- Created: 2014-04-22T15:49:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T18:20:38.000Z (about 2 years ago)
- Last Synced: 2024-11-09T04:47:10.605Z (about 1 month ago)
- Topics: koop-2, koop-provider, needs-update
- Language: JavaScript
- Homepage:
- Size: 90.8 KB
- Stars: 5
- Watchers: 9
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# koop-gist
[![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-gist.svg)](https://greenkeeper.io/)
> Github gist provider for [Koop](https://github.com/esri/koop)
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url][npm-image]: https://img.shields.io/npm/v/koop-gist.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/koop-gist
[travis-image]: https://img.shields.io/travis/koopjs/koop-gist.svg?style=flat-square
[travis-url]: https://travis-ci.org/koopjs/koop-gistTake GeoJSON from a Github [gist](https://help.github.com/articles/about-gists/) and serve it as an ArcGIS Feature Service, CSV, KML, or Shapefile.
## Install
Koop providers require that you first install Koop. For information on using Koop, see https://github.com/esri/koop.
You can add `koop-gist` to your Koop server's dependencies by installing it with npm and adding it to your package.json like so:
```
npm install koop-gist --save
```## Usage
Make sure your koop configuration includes a github access token (`ghtoken` in the config object passed to koop or `KOOP_GIST_TOKEN` as an environmental variable). Your Github API requests will be rate limited and you will not have access private gists if you don't include a token.
```js
var koop = require('koop')({
'ghtoken': 'XXXXXX' // defaults to `process.env.KOOP_GIST_TOKEN`
})
var koopGist = require('koop-gist')koop.register(koopGist)
var app = require('express')()
app.use(koop)
app.listen(process.env.PORT || 1337, function () {
console.log('Listening at http://%s:%d/', this.address().address, this.address().port)
})
```There is an example server in the [`example`](example) directory.
Once `koop-gist` is registered as provider and you've restarted your Koop server, you can preview GeoJSON files in gists using this pattern:
```
/gist/{gist id}/preview
```so for example:
```
/gist/6178185/preview
```## Test
`koop-gist` uses [tape](https://github.com/substack/tape) for testing. It is recommended to create your own Github [access token](https://github.com/settings/tokens) for use during testing to ensure you will not hit Github API rate limits.
```
KOOP_GIST_TOKEN=XXXXXX npm test
```## Contributing
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/Esri/contributing).
## License
[Apache 2.0](LICENSE)