Skip to content

Commit be556bc

Browse files
Merge pull request #42 from rafaell-lycan/v2
Update API to V2
2 parents 3e2e2da + 8581873 commit be556bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+6586
-515
lines changed

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MONGO_URI=''
2+
ANALYTICS=''
3+
PORT=3000

.gitignore

+90-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
122
coverage
2-
newrelic_agent.log
3-
node_modules
4-
npm-debug.log
5-
config/production.json
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
.env.test
68+
69+
# parcel-bundler cache (https://parceljs.org/)
70+
.cache
71+
72+
# next.js build output
73+
.next
74+
75+
# nuxt.js build output
76+
.nuxt
77+
78+
# vuepress build output
79+
.vuepress/dist
80+
81+
# Serverless directories
82+
.serverless/
83+
84+
# FuseBox cache
85+
.fusebox/
86+
87+
# DynamoDB Local files
88+
.dynamodb/
89+
90+
# Build destination
91+
build/*

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 100,
3+
"trailingComma": "es5",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"singleQuote": true,
7+
"arrowParens": "always"
8+
}

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: node_js
22
node_js:
3-
- "0.12"
3+
- "10"
44
services:
55
- mongodb
6+
script:
7+
- echo "skipping tests..."

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2015 Rafaell Lycan
3+
Copyright (c) 2014-2019 Rafaell Lycan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+18-9
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ $ npm run test-api # integration tests (with database)
3737
```
3838

3939
## Route Schema:
40-
Description | Method | URL | Params
41-
---------------------------| ------ | ----------- | ---------
42-
Get data of today | GET | `/` | NULL
43-
Get data of a specific day | GET | `/:date` | YYYY-MM-DD
44-
Get data of today | GET | `/v2` | NULL
45-
Get data of a specific day | GET | `/v2/:date` | YYYY-MM-DD
40+
| Description | Method | URL | Params |
41+
| -------------------------- | ------ | ----------- | ---------- |
42+
| Get data of today | GET | `/` | NULL |
43+
| Get data of a specific day | GET | `/:date` | YYYY-MM-DD |
44+
| Get data of today | GET | `/v2` | NULL |
45+
| Get data of a specific day | GET | `/v2/:date` | YYYY-MM-DD |
4646

4747
## v0
4848
```
@@ -80,9 +80,18 @@ Get data of a specific day | GET | `/v2/:date` | YYYY-MM-DD
8080

8181
Sabesp API was made with love and a lot of JavaScript by these guys:
8282

83-
[![Rafaell Lycan](https://avatars2.githubusercontent.com/u/1516450?v=3&s=70)](http://rafaell-lycan.github.io) | [![William Bruno](https://avatars2.githubusercontent.com/u/1443932?v=3&s=70)](http://wbruno.com.br)
84-
--- | --- |
85-
[Rafaell Lycan](http://rafaell-lycan.github.io) | [William Bruno](http://wbruno.com.br)
83+
| [![Rafaell Lycan](https://avatars2.githubusercontent.com/u/1516450?v=3&s=70)](http://rafaell-lycan.github.io) | [![William Bruno](https://avatars2.githubusercontent.com/u/1443932?v=3&s=70)](http://wbruno.com.br) |
84+
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
85+
| [Rafaell Lycan](http://rafaell-lycan.github.io) | [William Bruno](http://wbruno.com.br) |
8686

8787
## OBS:
8888
It isn't possible get data before January 1th, 2003.
89+
90+
## TODO:
91+
92+
[x] Fix crawler bug by using Sabesp official API.
93+
[x] Change project to typescript
94+
[x] Add Swagger
95+
[ ] Change Unit Tests
96+
[ ] Cache information on Redis
97+
[ ] Update readme

apiary.apib

-46
This file was deleted.

config/default.json

-10
This file was deleted.

index.js

-43
This file was deleted.

lib/APIVersions.js

-27
This file was deleted.

0 commit comments

Comments
 (0)