https://github.com/tableflip/landexplorer-api
:world_map: A graphql api for the landexplorer data
https://github.com/tableflip/landexplorer-api
Last synced: about 1 year ago
JSON representation
:world_map: A graphql api for the landexplorer data
- Host: GitHub
- URL: https://github.com/tableflip/landexplorer-api
- Owner: tableflip
- License: agpl-3.0
- Created: 2016-12-15T15:07:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-14T21:24:23.000Z (over 9 years ago)
- Last Synced: 2025-02-15T12:46:47.749Z (over 1 year ago)
- Language: Shell
- Homepage: http://landexplorer.uk/
- Size: 18.1 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# landexplorer-api
:world_map: A graphql api for the landexplorer data.
**Installing & Running the server**
Run the following commands to install and start the service
```sh
npm install && npm start
```
**Usage**
For working with the API you can start a dev server that will restart the server after changes using:
```
npm run watch
```
There is a graphical interface that you can use to test your queries. visit [localhost:8080/graphiql](http://localhost:8080/graphiql) and type in the following:
```
{
inspireId(lng: "-1.25390", lat: "51.76110")
}
```
The service will return your inspireId for that lng lat
```
{
"data": {
"inspireId": "27567047"
}
}
```
**Running the tests**
To run the tests you will need to create a database in postgres like this:
`CREATE DATABASE inspire_tests;`
Then connect to `inspire_tests` database using `\connect inspire_tests;`
Now extend the schema definition of inspire_tests to include geometry by using:
`CREATE EXTENSION postgis;`
To seed the database requires you to have GDAL installed with a Postgres driver
`brew install gdal --with-postgresql`
You can then seed the database by Running
```
npm run seed
```