Skip to content

flight endpoint fix #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 223 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
6049ec2
Added project wide ES6 support
kristjanmik Oct 28, 2015
06db57f
added main and start to package.json
kristjanmik Oct 28, 2015
f00e1f3
Merge pull request #239 from apis-is/feature/es6
koddsson Oct 29, 2015
a8915fd
Added Borgun provider to the currency endpoint
jonoskar Feb 10, 2016
65a8c3f
Merge pull request #243 from jonoskar/currency-borgun
koddsson Feb 11, 2016
37be226
Update redis package
koddsson Feb 13, 2016
20370cb
Don't display redis errors when not in debug mode
koddsson Feb 13, 2016
c34d4d2
Add a simple makefile
koddsson Feb 13, 2016
38e1f03
Lint realtime bus endpoint. No code change.
koddsson Feb 13, 2016
44675f2
Fix makefile
koddsson Feb 13, 2016
7ea5d67
Fix object reference error
koddsson Feb 13, 2016
c47068c
Fix indenting. No code change.
koddsson Feb 13, 2016
e4b5d27
Fix URL for golf endpoint
koddsson Feb 13, 2016
907611e
Add missing package
koddsson Feb 13, 2016
1443492
Disable skjar1 endpoint
koddsson Feb 13, 2016
317881e
Double the timeout for the RUV endpoints
koddsson Feb 13, 2016
c6013a4
Skip tests that fail on travis
koddsson Feb 13, 2016
1c6f0f4
Merge pull request #244 from apis-is/some-cleanup
koddsson Feb 13, 2016
d6bea68
Adopting ES2015 syntax and fix tests accordingly
kristjanmik Feb 13, 2016
9f59b29
Fixed and rewrote /cinema
kristjanmik Feb 13, 2016
e101c23
express 4 syntax for status codes
kristjanmik Feb 13, 2016
675a549
Merge pull request #248 from apis-is/patch-status-syntax
kristjanmik Feb 13, 2016
e119105
Fixed tests
kristjanmik Feb 13, 2016
d29aa86
Merge
kristjanmik Feb 13, 2016
307bc6a
Merge branch 'patch-rewrite'
kristjanmik Feb 13, 2016
cf4d3cb
merge
kristjanmik Feb 13, 2016
5ee9181
Merge branch 'patch-cinema'
kristjanmik Feb 13, 2016
e20ca24
Add a metrics middleware to app
koddsson Feb 15, 2016
461cd3e
Merge pull request #249 from apis-is/add-metrics-endpoint
kristjanmik Feb 15, 2016
bfa2437
Metrics endpoints for #249
kristjanmik Feb 15, 2016
104e718
Merge pull request #250 from apis-is/patch-metrics-endpoint
koddsson Feb 15, 2016
ec76bee
Some global error handling
kristjanmik Feb 15, 2016
0d00c24
Better number handling
kristjanmik Feb 15, 2016
ca9d559
Merge pull request #251 from apis-is/patch-error-handling
koddsson Feb 15, 2016
23e67c0
Cleaned up some endpoints
kristjanmik Feb 15, 2016
f6ffa5a
Merge pull request #252 from apis-is/patch-endpoint-cleanup
koddsson Feb 16, 2016
a48257c
Change cwd for production
kristjanmik Feb 16, 2016
ba19ac6
Merge pull request #253 from apis-is/patch-prod-env
kristjanmik Feb 16, 2016
24fe0fd
chore(package): update dependencies
greenkeeperio-bot Feb 23, 2016
d96d7b2
Add babelrc and change import of babel/register
koddsson Feb 23, 2016
55aa441
Fix declencion endpoint
koddsson Feb 23, 2016
8214ec9
Change mocha test reporter
koddsson Feb 23, 2016
fcc2316
Bump timeout to 2seks for generic test
koddsson Feb 24, 2016
d65fd7d
Fix earthquake endpoint after cheerio upgrade
koddsson Feb 24, 2016
083fcfc
Remove hack and indent file
koddsson Feb 24, 2016
4e46510
Mapping over a object returns a weird object
koddsson Feb 24, 2016
690b4e3
Switch period and number variables in moment.subtract()
koddsson Feb 24, 2016
9e85566
Bump generic test timeout to 10seks
koddsson Feb 24, 2016
39d6705
Merge pull request #255 from apis-is/greenkeeper-update-all
koddsson Feb 25, 2016
490a607
chore(package): update xregexp to version 3.1.0
greenkeeperio-bot Feb 24, 2016
70abb13
Fix `xregexp` API call
koddsson Feb 25, 2016
7d7f790
Merge pull request #256 from apis-is/greenkeeper-xregexp-3.1.0
koddsson Feb 25, 2016
6d5b7b7
log out the error stack for swallowed errors
kristjanmik Mar 4, 2016
56c4379
Merge pull request #258 from apis-is/patch-better-errors
kristjanmik Mar 4, 2016
3dff3d2
chore(package): update moment to version 2.12.0
greenkeeperio-bot Mar 7, 2016
31b9523
Merge pull request #259 from apis-is/greenkeeper-moment-2.12.0
koddsson Mar 7, 2016
f0430a5
Set decodeEntities to false to prevent a html encoded string
olitomas Mar 12, 2016
397ca89
Merge pull request #261 from olitomas/patch-1
kristjanmik Mar 12, 2016
bec035d
Fixed deprication warnings
kristjanmik Mar 18, 2016
68dea1e
Merge pull request #265 from apis-is/patch-deprication-warnings
kristjanmik Mar 18, 2016
d40826b
Make sure we dont continue because shit hits the fan
MiniGod Mar 26, 2016
df15f3a
lottery: Less throwing in async
MiniGod Mar 26, 2016
4060d06
tv/365: No more throwing in async
MiniGod Mar 26, 2016
f052fd5
tv/ruv: No more throwing in async
MiniGod Mar 26, 2016
784bdd6
travis: Add node 5 and remove 0.11 and iojs
MiniGod Mar 26, 2016
39c316e
Merge pull request #269 from MiniGod/disable-tv-skjar1
kristjanmik Mar 29, 2016
9a61196
Merge pull request #270 from MiniGod/less-throwing
kristjanmik Mar 29, 2016
8bf5943
Merge pull request #271 from MiniGod/travis-node-versions
kristjanmik Mar 29, 2016
5a7da0d
Skipping lottery tests for now
kristjanmik Mar 31, 2016
8724fc2
Update redis to version 2.5.3 🚀
greenkeeperio-bot Apr 2, 2016
5d2fae0
chore(package): update file to version 0.2.2
greenkeeperio-bot Apr 2, 2016
007f43c
chore(package): update babel-core to version 6.7.4
greenkeeperio-bot Apr 2, 2016
9074841
Added worldfengur scraper
Loknar Apr 3, 2016
3080c80
[WIP] Add eslint
koddsson Apr 4, 2016
81260b1
Up the timeout for a flaky /horses test
koddsson Apr 4, 2016
36f8e5e
Initial issue and PR templates
koddsson Apr 6, 2016
54d1451
Merge pull request #277 from apis-is/add-issue-and-pr-templates
kristjanmik Apr 6, 2016
298d72b
Update the README file
koddsson Apr 6, 2016
0500a31
Update formatting for pr and issue templates
koddsson Apr 6, 2016
2e1efb6
Merge pull request #278 from apis-is/update-readme
kristjanmik Apr 6, 2016
576feb5
My assumptions in https://github.com/apis-is/apis/pull/273 that we wo…
Loknar Apr 6, 2016
47e92c1
fixing lint issues from my last PR https://github.com/apis-is/apis/pu…
Loknar Apr 6, 2016
be32d97
Enforce semicolumns in codebase (#282)
koddsson Apr 9, 2016
19ca5dc
Enforce no-semicolons in codebase (#283)
benediktvaldez Apr 11, 2016
b533719
Update README.md
koddsson Apr 25, 2016
2e90b2d
Merge pull request #284 from apis-is/update-readme
kristjanmik Apr 25, 2016
6e94268
Fixing the error handler caused by apis-is#274
MiniGod May 4, 2016
2aa1a23
Merge pull request #285 from apis-is/fix-error-handler
kristjanmik May 4, 2016
39a205b
Use the provided element in a `.each()` call.
koddsson May 5, 2016
478ef6f
Merge pull request #287 from apis-is/fix-286
kristjanmik May 6, 2016
8581b2d
Added isnic endpoint (#292)
sse87 Jun 6, 2016
f4ed774
TV: Ignore failing tests
koddsson Jun 6, 2016
d2c34bc
Added petrol stations endpoint (#290)
Loknar Jun 6, 2016
8597bee
Fix sports football (#293)
raggiadolf Jun 6, 2016
c35ab89
Added functionality for types of currencies in arion (#294) (#296)
gsmari Jun 11, 2016
290bf3c
Add calendar endpoint (#297)
koddsson Jun 20, 2016
7768f2e
Wrong date in beginDate parameter (#298)
gsmari Jun 22, 2016
877e63b
Adding addresses to graphql endpoint
arnarthor Jul 23, 2016
5d9eb3e
Fixing lint errors
arnarthor Jul 23, 2016
0af69bd
Change file structure a bit
arnarthor Jul 23, 2016
29f69a0
Adding definition for realtime bus information
arnarthor Jul 23, 2016
2027718
Fixing minor bug with busses argument
arnarthor Jul 23, 2016
7f3b580
Adding nodemon as a dev dependency
arnarthor Jul 23, 2016
a33818f
Merge pull request #299 from arnarthor/all-data-as-graphql-endpoint
kristjanmik Jul 25, 2016
02dcdf4
Add a script to run a single integration test
tryggvigy Jul 25, 2016
45aabe0
make mocha only run test/index.js on `npm test`
tryggvigy Jul 25, 2016
ba9cbcb
Merge pull request #301 from tryggvigy/run-integration-test-single
kristjanmik Jul 25, 2016
396a1cb
Add sentry error tracking (#304)
koddsson Jul 25, 2016
0bf88f1
Add `calendar/` endpoint to GraphQL server (#303)
tryggvigy Jul 31, 2016
7ebc8e0
Add `/car` endpoint to GraphQL server (#317)
tryggvigy Aug 4, 2016
ac31f5b
Fixes #329 (#335)
MiniGod Oct 12, 2016
3488169
Bus: Rename `res` variable to `response` (#325)
koddsson Oct 12, 2016
ecb5e31
Add a yarn.lock file (#336)
koddsson Oct 13, 2016
17a5a72
Fix DOM selecting in `/cinema` endpoint (#337)
koddsson Oct 13, 2016
5904178
Temporarily remove graphql endpoint
koddsson Oct 14, 2016
e142805
Remove cinema tests
koddsson Oct 14, 2016
c642bf0
Remove unused variables
koddsson Oct 14, 2016
e1251c9
Don't load graphql schemas
koddsson Oct 14, 2016
bc22e47
Ignore all graphql endpoints
koddsson Oct 14, 2016
0f12e0d
hotfix
kristjanmik Oct 14, 2016
cc210e3
Update server.js
kristjanmik Oct 14, 2016
3f8ccca
Added try around module loader
kristjanmik Oct 14, 2016
6220afb
Auroracoin endpoint, data from isx.is
Loknar May 3, 2017
f666335
remove prints ;_;
Loknar May 3, 2017
c9338f1
fix headers issue
Loknar Jun 22, 2017
81e57ae
don't wear random UA mask
Loknar Jun 22, 2017
92789d6
Merge pull request #365 from Loknar/master
kristjanmik Jun 23, 2017
3af975e
Fix lint
MiniGod Jul 6, 2017
cf0fb84
test: Use indexOf instead of includes in aur test
MiniGod Jul 6, 2017
e2d4808
New endpoint /ship responds with data
Mar 28, 2017
82c92e5
/ship endpoint working properly
Sep 1, 2017
60ede9e
Adding tests for /ship endpoint
Sep 1, 2017
b97af77
Remove bad graphql_schema from /ship enpoint
Sep 1, 2017
336b8b9
Some cleanup
Sep 1, 2017
cc81a2e
Cleanup
Sep 1, 2017
8def392
Merge pull request #372 from GunnarSturla/master
kristjanmik Oct 10, 2017
313aa64
disable broken bus tests
kristjanmik Oct 10, 2017
4aaac80
Create .circleci
Oct 11, 2017
5289850
Update .circleci
Oct 11, 2017
806b983
Update .circleci
Oct 11, 2017
cd95f18
chore: rename `.circleci` -> `.circleci/config.yml`
koddsson Oct 11, 2017
61dcd62
Create stale.yml
Oct 12, 2017
cf95652
Update eslint packages (#375)
Oct 12, 2017
9532eec
Create CODEOWNERS
Oct 12, 2017
848ba06
chore(test): mock all request responses (#376)
Oct 13, 2017
5e4f7c6
chore: set node version in package.json
koddsson Oct 13, 2017
0bd9821
chore: replace `babel-preset-2015` with `-env`
koddsson Oct 13, 2017
282d84d
Revert "chore: replace `babel-preset-2015` with `-env`"
koddsson Oct 13, 2017
9a702e0
fix: don't enforce dangling commas in functions
koddsson Oct 13, 2017
28c1fed
chore(tests): use glob instead of walking files (#380)
Oct 14, 2017
03df423
Fix 381 (#382)
Oct 14, 2017
3248851
Good bye babel
MiniGod Oct 14, 2017
0e8c381
Put `makeDebug` and `debug =` on one line
MiniGod Oct 14, 2017
3b5ad86
fix(yarn): set correct value in engines.node
koddsson Oct 14, 2017
d56507c
chore(yarn): generate yarn.lock
koddsson Oct 14, 2017
21bdc8a
chore: replace yarn package manager with npm (#385)
Oct 14, 2017
6a42345
Update dependencies to enable Greenkeeper 🌴 (#384)
greenkeeper[bot] Oct 15, 2017
f5b690d
Merge branch 'master' of github.com:apis-is/apis into rip-babel
MiniGod Oct 15, 2017
69ee97d
chore(npm): regenerate package.lock
koddsson Oct 15, 2017
4c8075d
fix(docs)
Oct 15, 2017
bea6746
Merge branch 'master' of github.com:apis-is/apis into rip-babel
MiniGod Oct 15, 2017
28465a5
Merge pull request #383 from MiniGod/rip-babel
MiniGod Oct 15, 2017
fbefcb2
Added back index.js
MiniGod Oct 15, 2017
d3cc581
lib/cache.js: debug more
MiniGod Oct 15, 2017
1da2d74
Enable caching on a lot of endpoints
MiniGod Oct 15, 2017
52fa2e8
chore: remove unused packages (#387)
Oct 15, 2017
447139c
Update README.md
Oct 15, 2017
02ae60c
Create LICENSE
Oct 15, 2017
13ba86e
Update package.json
Oct 15, 2017
89c3a53
chore: remove Makefile
koddsson Oct 15, 2017
9e49793
chore: deprecate config module
koddsson Oct 15, 2017
dfbf904
Merge pull request #388 from MiniGod/cache-more
MiniGod Oct 15, 2017
9012416
fix: enable metrics endpoint
koddsson Oct 15, 2017
18f2bcb
chore: enable server debug messages
koddsson Oct 15, 2017
0af32fd
Merge pull request #391 from koddsson/enable-metrics-endpoint
MiniGod Oct 15, 2017
2c964de
fix(tv): there's not station called stod2gull
koddsson Oct 15, 2017
1660719
fix(lint): add missing newline
koddsson Oct 15, 2017
2fd2842
chore: re-enable company tests
koddsson Oct 15, 2017
509b41e
chore: re-record mock data
koddsson Oct 15, 2017
fe15a4b
Merge branch 'master' into deprecate-config
Oct 15, 2017
a19fe02
Merge pull request #389 from apis-is/add-license-1
kristjanmik Oct 16, 2017
9f104c1
Merge pull request #396 from koddsson/re-enable-company-tests
kristjanmik Oct 16, 2017
38b9750
Merge pull request #395 from koddsson/remove-stod2gull
kristjanmik Oct 16, 2017
80a663b
Merge pull request #390 from koddsson/deprecate-config
kristjanmik Oct 16, 2017
0fa73e5
Fix 392 (#393)
Oct 16, 2017
34938f5
Update axios to the latest version 🚀 (#400)
greenkeeper[bot] Oct 22, 2017
a0b345a
Update sinon to the latest version 🚀 (#402)
greenkeeper[bot] Oct 26, 2017
c5fb200
chore(lottery): wrap tests in a `describe()`
koddsson Oct 29, 2017
83cece7
chore(horses): wrap tests in a `describe()`
koddsson Oct 29, 2017
6e19acf
chore(package): update sinon to version 4.1.1 (#405)
Nov 6, 2017
bd1810d
Dont mock localhost (#403)
Nov 7, 2017
1875348
Update sinon to the latest version 🚀 (#406)
greenkeeper[bot] Nov 7, 2017
dc08dd8
re-record mock data
koddsson Dec 11, 2017
0f56a37
chore(package): update sinon to version 4.1.3 (#410)
greenkeeper[bot] Dec 11, 2017
375b205
fix(package): update raven to version 2.3.0 (#411)
greenkeeper[bot] Dec 11, 2017
b8c51dc
trim field labels in horses endpoint (#408)
Dec 11, 2017
fb35df1
chore(package): update nodemon to version 1.12.5 (#412)
Dec 11, 2017
495f12a
don't mark bugs as stale
Dec 14, 2017
f3dc510
feat: generate documentation from markdown files (#378)
Dec 14, 2017
ece94d5
chore(package): update nodemon to version 1.12.7 (#414)
Dec 14, 2017
826cc93
make sure the docs distribution folder exists
koddsson Dec 14, 2017
ed26353
generate the correct package-lock.json since greenkeeper did not
koddsson Dec 14, 2017
eadb2be
chore(package): update nodemon to version 1.14.3 (#420)
Dec 28, 2017
25171c0
fix(package): update expect to version 22.0.3 (#421)
Dec 28, 2017
604193a
fix(package): update moment to version 2.20.1 (#423)
Dec 28, 2017
87779cc
fix(package): update graphql to version 0.12.3 (#422)
Dec 28, 2017
1fb161a
Replace eslint with xo (#397)
Dec 28, 2017
8abcb01
Better metrics (#401)
Dec 28, 2017
4fc9944
add additional metadata that we send to sentry
koddsson Dec 28, 2017
74024ac
fix mock for arion banki
MiniGod Mar 24, 2018
8d03a88
Updated dependencies
MiniGod Mar 24, 2018
adfc9c5
Merge pull request #438 from MiniGod/update-dependencies
kristjanmik Mar 26, 2018
477992e
fix(package): update moment to version 2.22.1 (#447)
Apr 30, 2018
7fe5d54
chore(package): update nodemon to version 1.17.3 (#440)
greenkeeper[bot] Apr 30, 2018
b73a012
fix(package): update iconv-lite to version 0.4.21 (#448)
Apr 30, 2018
c5b455d
fix(package): update mocha to version 5.1.1 (#449)
May 1, 2018
29039ef
chore(package): update sinon to version 5.0.1 (#446)
greenkeeper[bot] May 1, 2018
8aa6527
chore(package): update sinon to version 5.0.3 (#452)
May 2, 2018
1c82c86
style: update xo to latest
MiniGod May 17, 2018
b5f1e29
Merge pull request #457 from MiniGod/update-xo
MiniGod May 18, 2018
fb26538
Prevent sentry/raven install when dns is missing
sse87 Sep 28, 2018
3c5810b
lint
sse87 Sep 28, 2018
0ac343f
Merge pull request #471 from sse87/check-for-sentry-dns-string
kristjanmik Sep 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: npm run lint
- run: npm run test
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @koddsson @kristjanmik @benediktvaldez @MiniGod
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Describe the issue you are having here.

### Steps to reproduce

Is it a issue with:
- the service running on http://apis.is?
- running the service locally?
- documentation?
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Describe this code change as best you can here. Is it a new endpoint, bugfix or
changes to the documentation?

### Checklist

- [ ] Write tests
- [ ] Write documentation
16 changes: 16 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
node_modules
config/*.config.json
npm-debug.log
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2012-2017 APIs.is

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 47 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[![Build Status](https://travis-ci.org/apis-is/apis.svg?branch=master)](https://travis-ci.org/apis-is/apis)
# [APIs.is](http://apis.is) - Making data pretty since 2012!

[![Codeship](https://img.shields.io/codeship/7c0ce5a0-9901-0132-893b-365d53813970/master.svg)](https://codeship.com/projects/63542)
[![Greenkeeper badge](https://badges.greenkeeper.io/apis-is/apis.svg)](https://greenkeeper.io/)

The purpose of [APIs.is](http://apis.is) is to make data readily available to anyone interested. All data that is delivered through APIs.is is JSON formatted and scraped from open public websites.

The code that is running the service is open source under the [MIT licence](https://en.wikipedia.org/wiki/MIT_License). The platform itself is hosted on a load balanced setup by [GreenQloud](http://www.greenqloud.com) to be as antifragile as possible. The hosted service does not store any information, so all data is gathered on runtime and disregarded immediately afterwards.
The code that is running the service is open source under the [MIT licence](https://en.wikipedia.org/wiki/MIT_License). The platform itself is hosted on a load balanced setup by [Advania](https://www.advania.com/).

**Don't hesitate to lend a hand - All knowledge and help is much appreciated!**

##Maintainers
## Maintainers

[@kristjanmik](https://github.com/kristjanmik/)

Expand All @@ -17,15 +19,44 @@ The code that is running the service is open source under the [MIT licence](http

[@MiniGod](https://github.com/minigod/)

## Tests
## Running locally

To run the project locally, first clone this repository...
```sh
$ git clone https://github.com/apis-is/apis.git
```

.... install the dependencies and run the project.

```sh
$ npm install
[Bunch of output]
$ npm run
```

Currently there are two types of tests, integration and unit tests. All tests are created using [Mocha](http://visionmedia.github.io/mocha/).
## Tests

To run the integration tests:
To run the tests:
```sh
$ npm test
```

The tests utilize a man-in-the-middle library called [nock](https://github.com/node-nock/nock) that
intercepts requests that the tests made and respond with data from disk. The data was generated using
the [record feature](https://github.com/node-nock/nock#recording) and saved in [`mock-data.json`](mock-data.json).

If a endpoints data source has changed and the we need to re-record this data we can simply set the
env variable `RECORD_MOCK_DATA` to a truthy value and run the tests. This will disable nock in the tests
and make requests to each endpoints data source and save that to disk.

```sh
RECORD_MOCK_DATA=true npm test
```

Newly added endpoints should mock the endpoints data source using the `nock` API since this initial
data mocking was only made to help migrate to a mocking library. See the [original PR](https://github.com/apis-is/apis/pull/376)
for more info.

## Adding a new Endpoint

### Step by Step
Expand All @@ -35,27 +66,28 @@ $ npm test
3. The file will be loaded automatically. Remember to require the server. Bare minimum example endpoint:

```javascript
var app = require('../../server');
const app = require('../../server');

app.get('/path',function(req,res){
return res.json({}); //Sends out empty json object
app.get('/path', (req,res) => {
//Sends out empty json object
return res.json({});
});
```

### Additional requirements

Add [integration tests](http://en.wikipedia.org/wiki/Integration_testing) to the endpoint by creating a file called `integration_test.js` inside a `tests/` folder within your endpoint directory. For reference, please take a look at one of the integration tests.
Add integration tests to the endpoint by creating a file called `integration_test.js` inside a `tests/` folder within your endpoint directory. For reference, please take a look at one of the integration tests.

Add [documentation](https://github.com/kristjanmik/apis-docs) for your endpoint
Add documentation for your endpoint to the `gh-pages` branch of this repo.

### More servers

To ensure close to zero downtime, the plan is to start up more workers/servers around the world so that projects relying on this service will not be affected. Want to help out with that? Feel free to send us a [line](mailto:apis@apis.is)!
To ensure close to zero downtime, the plan is to start up more workers/servers around the world so that projects relying on this service will not be affected. Want to help out with that? Feel free to contact us by opening a [issue](https://github.com/apis-is/apis/issues/new).

### Helpful pointers

- Endpoints can implement any node module.
- Endpoints can implement any node module, but try to use the ones that are already included in the project.
- Information on how to handle requests and responses can be found [here](http://expressjs.com/api.html).
- It is much appreciated that endpoints are thoroughly documented and written with care.
- Issues are managed by the [GitHub issue tracker](https://github.com/kristjanmik/apis/issues).
- Have fun and eat some cake! (preferrably chocolate, but whatever floats your boat)
- Issues are managed by the [GitHub issue tracker](https://github.com/apis-is/apis/issues).
- Have fun and eat some cake! (preferrably just some plain vanilla cake, but whatever floats your boat)
5 changes: 0 additions & 5 deletions config/default.json

This file was deleted.

16 changes: 0 additions & 16 deletions config/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/integration.json

This file was deleted.

1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
47 changes: 47 additions & 0 deletions docs/header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style>
body {
background-color: #fdf6e3;
font-family: 'Open Sans',Arial,tahoma,sans-serif;
color: #06568F;
line-height: 1.5;
font-size: 18px;
font-weight: 300;
max-width: 860px;
margin: auto;
}
a {
color: #268bd2;
}
ul {
list-style: none;
padding: 0;
}
li {
background-color: #268bd2;
color: #fdf6e3;
padding: 10px 20px;
border-radius: 2px;
}
li > a {
color: #fdf6e3;
}
h1, h2, h3 {
font-weight: 300;
margin: 0;
}
table {
width: 100%;
}
th {
text-align: left;
}
td:last-child,
th:last-child {
text-align: right;
}
hr {
border-top-style: dashed;
}
</style>

13 changes: 13 additions & 0 deletions endpoints/address/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Icelandic Addresses

Source [Iceland Post](https://postur.is)

- GET [/address](https://apis.is/address)

Lookup addresses in Iceland through the Icelandic Post API

| Parameters | Description | Example |
|--------------------|---------------|--------------------------------------------------------|
| Address (required) | Valid address | [Laugarvegur 1](https://apis.is/address/Laugarvegur 1) |

---
49 changes: 49 additions & 0 deletions endpoints/address/graphql_schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const {
GraphQLObjectType,
GraphQLList,
GraphQLString,
} = require('graphql')

const lookupAddresses = require('.')

const addressType = new GraphQLObjectType({
name: 'Address',
fields: {
street: {
type: GraphQLString,
description: 'The name of the street the address belongs to',
},
house: {
type: GraphQLString,
description: 'The house number the address belongs to',
},
zip: {
type: GraphQLString,
description: 'The zip code where this address is registered',
},
city: {
type: GraphQLString,
description: 'The city where this address is registered',
},
apartment: {
type: GraphQLString,
description: 'A name for an apartment belonging to this address',
},
letter: {
type: GraphQLString,
},
},
})

const addressesType = new GraphQLList(addressType)

module.exports = {
type: addressesType,
args: {
address: { type: GraphQLString },
},
resolve: (_, args) => {
const address = args.address.replace(' ', '+')
return lookupAddresses(address)
},
}
Loading