# koop-provider-sample

> A sample provider for koop

Latest version **1.0.1** (published 2017-10-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install koop-provider-sample
pnpm add koop-provider-sample
yarn add koop-provider-sample
bun add koop-provider-sample
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-10-20 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Daniel Fenton |
| Maintainers | dmfenton |
| Keywords | koop, provider, sample |

## Links

- npm: https://www.npmjs.com/package/koop-provider-sample
- Repository: https://github.com/koopjs/koop-provider-sample
- Issues: https://github.com/koopjs/koop-provider-sample/issues
- npm.io page: https://npm.io/package/koop-provider-sample

## Dependencies (11)

- [koop](https://npm.io/package/koop.md) ^3.5.2
- [config](https://npm.io/package/config.md) ^1.25.1
- [request](https://npm.io/package/request.md) ^2.79.0
- [@turf/turf](https://npm.io/package/@turf/turf.md) ^4.7.3
- [featureservice](https://npm.io/package/featureservice.md) ^1.5.11
- [esri-to-geojson](https://npm.io/package/esri-to-geojson.md) ^1.0.3
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.1
- [@koopjs/cache-redis](https://npm.io/package/@koopjs/cache-redis.md) ^1.0.1
- [@mapbox/geojson-merge](https://npm.io/package/@mapbox/geojson-merge.md) ^1.0.2
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.4
- [@esri/arcgis-to-geojson-utils](https://npm.io/package/@esri/arcgis-to-geojson-utils.md) ^1.0.4

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-10-20

## README

[![Build Status](https://travis-ci.org/koopjs/koop-provider-sample.svg?branch=master)](https://travis-ci.org/koopjs/koop-provider-sample) [![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-provider-sample.svg)](https://greenkeeper.io/)


# Koop Sample Provider

This is a sample that demonstrates how to build a Koop Provider. Full documentation is provided [here](https://koopjs.github.io/docs/specs/provider/).

The data source in this case is the [TriMet Bus API](https://developer.trimet.org). You can see this provider in action [here](http://dcdev.maps.arcgis.com/home/item.html?id=2603e7e3f10742f78093edf8ea2adfd8#visualize).

If you want to write your own provider, simply fork this repository or copy the contents.

## Files

| File | | Description |
| --- | --- | --- |
| `index.js` | Mandatory | Configures provider for usage by Koop |
| `model.js` | Mandatory | Translates remote API to GeoJSON |
| `routes.js` | Optional | Specifies additional routes to be handled by this provider |
| `controller.js` | Optional | Handles additional routes specified in `routes.js` |
| `server.js` | Optional | Reference implementation for the provider |
| `test/model-test.js` | Optional | tests the `getData` function on the model |
| `test/fixtures/input.json` | Optional | a sample of the raw input from the 3rd party API |
| `config/default.json` | Optional | used for advanced configuration, usually API keys. |

## Test it out
Run server:
- `npm install`
- `npm start`

Example API Query:
- `curl localhost:8080/sample/FeatureServer/0/query?returnCountOnly=true`

Tests:
- `npm test`

## With Docker

- `docker build -t koop-provider-sample .`
- `docker run -it -p 8080:8080 koop-provider-sample`

## Publish to npm
- run `npm init` and update the fields
  - Choose a name like `koop-provider-foo`
- run `npm publish`

---
_Source: https://npm.io/package/koop-provider-sample · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
