{"id":13701311,"url":"https://github.com/koopjs/koop-provider-example","last_synced_at":"2025-04-10T10:41:35.094Z","repository":{"id":16536823,"uuid":"19290192","full_name":"koopjs/koop-provider-example","owner":"koopjs","description":"Sample provider for Koop.","archived":false,"fork":false,"pushed_at":"2023-03-02T12:29:39.000Z","size":643,"stargazers_count":22,"open_issues_count":11,"forks_count":25,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-31T22:04:51.297Z","etag":null,"topics":["koop-provider"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"EFForg/privacybadger","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koopjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-04-29T20:12:31.000Z","updated_at":"2024-04-08T20:11:55.000Z","dependencies_parsed_at":"2024-04-08T04:12:00.603Z","dependency_job_id":null,"html_url":"https://github.com/koopjs/koop-provider-example","commit_stats":null,"previous_names":["koopjs/koop-provider-sample"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koopjs","download_url":"https://codeload.github.com/koopjs/koop-provider-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406171,"owners_count":20933825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["koop-provider"],"created_at":"2024-08-02T20:01:28.688Z","updated_at":"2025-04-10T10:41:35.067Z","avatar_url":"https://github.com/koopjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Koop Provider Example\n\n[![Build Status](https://travis-ci.org/koopjs/koop-provider-example.svg?branch=master)](https://travis-ci.org/koopjs/koop-provider-example) [![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/koop-provider-example.svg)](https://greenkeeper.io/)\n\n\nThis is an example that demonstrates how to build a Koop Provider. You can clone this project, and use it to start a new provider. This sample can run a local server, deploy to AWS Lambda or Docker for testing and operations. Once the provider is published to NPM, then it can be used with other Koop providers and outputs in a larger project.\n\nThe data source in this example 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).\n\nFull documentation is provided [here](https://koopjs.github.io/docs/usage/provider).\n\n## Getting started\n\n1. Open `config/default.json` with any configurable parameters\n1. Open `src/index.js` and change `provider.name` to a unique name\n1. Open `src/model.js` and implement `getData` to call your provider and return GeoJSON\n1. Install dependencies `npm install`\n1. Run a local dev server `npm start`\n1. Add tests to `test/`\n\n## Koop provider file structure\n\n| File | | Description |\n| --- | --- | --- |\n| `src/index.js` | Mandatory | Configures provider for usage by Koop |\n| `src/model.js` | Mandatory | Translates remote API to GeoJSON |\n| `src/routes.js` | Optional | Specifies additional routes to be handled by this provider |\n| `src/controller.js` | Optional | Handles additional routes specified in `routes.js` |\n| `test/model-test.js` | Optional | tests the `getData` function on the model |\n| `test/fixtures/input.json` | Optional | a sample of the raw input from the 3rd party API |\n| `config/default.json` | Optional | used for advanced configuration, usually API keys. |\n\n\n## Test it out\nRun server:\n- `npm install`\n- `npm start`\n\nExample API Query:\n- `curl localhost:8080/example/FeatureServer/0/query?returnCountOnly=true`\n\nTests:\n- `npm test`\n\n### Development output callstack logs\n\nDuring development you can output error callstack with\n\n- `NODE_ENV=test npm start`\n\n## Publish to npm\n\n- run `npm init` and update the fields\n  - Choose a name like `koop-provider-foo`\n- run `npm publish`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-provider-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoopjs%2Fkoop-provider-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-provider-example/lists"}