# @nobedtimes/provider-file-geojson-s3

> Simple provider for serving file-based GeoJSON from Minio

Latest version **1.0.1** (published 2022-03-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @nobedtimes/provider-file-geojson-s3
pnpm add @nobedtimes/provider-file-geojson-s3
yarn add @nobedtimes/provider-file-geojson-s3
bun add @nobedtimes/provider-file-geojson-s3
```

## 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 | 2022-03-24 |
| First published | 2022-03-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 19.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | stevensbriens |

## Links

- npm: https://www.npmjs.com/package/@nobedtimes/provider-file-geojson-s3
- Repository: https://github.com/spbrien/koop-provider-file-geojson-s3
- Homepage: https://github.com/spbrien/koop-provider-file-geojson-s3#readme
- Issues: https://github.com/spbrien/koop-provider-file-geojson-s3/issues
- npm.io page: https://npm.io/package/@nobedtimes/provider-file-geojson-s3

## Dependencies (4)

- [koop](https://npm.io/package/koop.md) ^3.7.0
- [minio](https://npm.io/package/minio.md) ^7.0.26
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15

## Recent versions

- 1.0.1 (latest) — 2022-03-24
- 1.0.0 — 2022-03-24

## README

# koop-provider-file-geojson

Serve local GeoJSON files as [Koop](https://github.com/koopjs/koop) services.  Use as a standalone Koop instance or add to an existing Koop implementation.

## Getting Started

Add the provider to your koop instance

``sh
$ npm install @koopjs/provider-file-geojson
``

Then register the provider with Koop in your server file.

```js
const Koop = require('koop')
const koop = new Koop()

const provider = require('@koopjs/provider-file-geojson')
koop.register(provider)
```

### Example server
The repository includes its own `server.js` that will start a Koop instance and register the file-geojson provider.  To start serving:

```sh
git clone https://github.com/koopjs/koop-provider-file-geojson

cd koop-provider-file-geojson

$ npm install

$ npm start
```

By default, Koop will start listening on `http://localhost:8080`.  Since the repo ships with sample GeoJSON in the `/data` directory, you can issue a request by using the extension-less filenames of GeoJSON found there.  For example, the following request will serve data from the file `data/polygon-sample.geojson` :
```
$ curl http://localhost:8080/file-geojson/rest/services/polygon-sample/FeatureServer/0/query
```

## Usage
### Data directory  
By default, the provider looks for files in the `data` directory that ships with the provider.  You can override this by setting an environment variable `KOOP_DATA_DIR=<path-to-directory>`.  The path should be relative to the `server.js` file.

### Files
All valid GeoJSON files can be served.  Place them in the data directory and ensure they have a `.geojson` file extension.

### Request parameters
Request a particular file by using the (extension-less) file name as the `:id` parameter in the URL.  For example, when requesting data from the file `point-fc.geojson`:
`http://localhost:8080/file-geojson/rest/services/:id/FeatureServer/0/query`

becomes:

`http://localhost:8080/file-geojson/rest/services/point-fc/FeatureServer/0/query` 

## Contributing

Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/Esri/contributing).

## License

[Apache 2.0](LICENSE)

---
_Source: https://npm.io/package/@nobedtimes/provider-file-geojson-s3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
