sat-api-lib
A library for creating a search API of public Satellites metadata using Elasticsearch
Last updated 2 years ago by dsio .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sat-api-lib 
SYNC missed versions from official npm registry.

sat-api-lib

npm version Build Status

We use this library for creating sat-api using API Gateway. You can use this API to build a standalone API in other frameworks such as Express

Test

$ npm install
$ npm run test

We use nock to record and save API calls to the ElasticSearch instance to speed up tests and freeze results in time.

To change the behaviour of Nock, update NOCK_BACK_MODE to wild, dryrun, record or lockdown. More info here.

Default is lockdown.

Express Example:

process.env.ES_HOST = 'link-to-my-elasticsearh.com';

var express = require('express');
var api = require('sat-api-lib');
var app = express();

app.get('/', function(req, res) {
  var search = new api(req);
  search.simple(function (err, resp) {
    res.send(resp);
  });
});

app.get('/count', function(req, res) {
  var search = new api(req);
  search.count(function (err, resp) {
    res.send(resp);
  });
});

app.get('/geojson', function(req, res) {
  var search = new api(req);
  search.geojson(function (err, resp) {
    res.send(resp);
  });
});

var port = process.env.PORT || 8000;
app.listen(port, function() {
  console.log('Listening on ' + port);
});

About

Sat API Lib was made by Development Seed.

Current Tags

  • 1.0.0-b5                                ...           latest (2 years ago)

15 Versions

  • 1.0.0-b5                                ...           2 years ago
  • 1.0.0-b4                                ...           2 years ago
  • 1.0.0-b3                                ...           2 years ago
  • 1.0.0-b2                                ...           2 years ago
  • 0.5.5                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           3 years ago
  • 0.5.0                                ...           4 years ago
  • 0.4.1                                ...           4 years ago
  • 0.4.0                                ...           4 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 15
Dependencies (9)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |