Skip to content

Commit

Permalink
Merge pull request #42 from rafaell-lycan/v2
Browse files Browse the repository at this point in the history
Update API to V2
  • Loading branch information
rafaell-lycan authored May 27, 2019
2 parents 3e2e2da + 8581873 commit be556bc
Show file tree
Hide file tree
Showing 53 changed files with 6,586 additions and 515 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MONGO_URI=''
ANALYTICS=''
PORT=3000
94 changes: 90 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,91 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
newrelic_agent.log
node_modules
npm-debug.log
config/production.json
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Build destination
build/*
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 100,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"arrowParens": "always"
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- "0.12"
- "10"
services:
- mongodb
script:
- echo "skipping tests..."
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2015 Rafaell Lycan
Copyright (c) 2014-2019 Rafaell Lycan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ $ npm run test-api # integration tests (with database)
```

## Route Schema:
Description | Method | URL | Params
---------------------------| ------ | ----------- | ---------
Get data of today | GET | `/` | NULL
Get data of a specific day | GET | `/:date` | YYYY-MM-DD
Get data of today | GET | `/v2` | NULL
Get data of a specific day | GET | `/v2/:date` | YYYY-MM-DD
| Description | Method | URL | Params |
| -------------------------- | ------ | ----------- | ---------- |
| Get data of today | GET | `/` | NULL |
| Get data of a specific day | GET | `/:date` | YYYY-MM-DD |
| Get data of today | GET | `/v2` | NULL |
| Get data of a specific day | GET | `/v2/:date` | YYYY-MM-DD |

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

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

[![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)
--- | --- |
[Rafaell Lycan](http://rafaell-lycan.github.io) | [William Bruno](http://wbruno.com.br)
| [![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) |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [Rafaell Lycan](http://rafaell-lycan.github.io) | [William Bruno](http://wbruno.com.br) |

## OBS:
It isn't possible get data before January 1th, 2003.

## TODO:

[x] Fix crawler bug by using Sabesp official API.
[x] Change project to typescript
[x] Add Swagger
[ ] Change Unit Tests
[ ] Cache information on Redis
[ ] Update readme
46 changes: 0 additions & 46 deletions apiary.apib

This file was deleted.

10 changes: 0 additions & 10 deletions config/default.json

This file was deleted.

43 changes: 0 additions & 43 deletions index.js

This file was deleted.

27 changes: 0 additions & 27 deletions lib/APIVersions.js

This file was deleted.

Loading

0 comments on commit be556bc

Please sign in to comment.