Skip to content

Commit

Permalink
api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chralp committed Dec 17, 2019
1 parent e471f5c commit 6a73f59
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ indent_size = 4
[*.js]
indent_size = 4

[{package.json,.travis.yml}]
[package.json]
indent_size = 2

[*.md]
Expand Down
25 changes: 25 additions & 0 deletions api.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
* API endpoints
** Get scoreboard

Append `given` or `givers` for different scoreboard

#+BEGIN_SRC http :pretty
GET http://heyburrito:3333/api/scoreboard/<type>
#+END_SRC

#+RESULTS:
#+begin_example
{
"error": false,
"code": 200,
"message": null,
"data": [
{
"username": "chralp",
"name": "chralp",
"score": 1337,
"avatar": "https://secure.gravatar.com/chralp.png"
}
]
}
#+end_example
5 changes: 3 additions & 2 deletions src/Bot.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { default as log } from 'bog';
import log from 'bog';
import { parseMessage } from './lib/parseMessage';
import { validBotMention, validMessage } from './lib/validator';
import BurritoStore from './store/BurritoStore';
import LocalStore from './store/LocalStore';
import config from './config'

// interfaces
import EmojiInterface from './types/Emoji.interface';
import SlackMessageInterface from './types/SlackMessage.interface';
import config from './config'


const dailyCap: number = parseInt(config.slack.daily_cap);

Expand Down
1 change: 0 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Bot from './Bot';

log.level(config.misc.log_level);


// HTTP handlers
import APIHandler from './api';
import WEBHandler from './web';
Expand Down

0 comments on commit 6a73f59

Please sign in to comment.