1
0
mirror of https://github.com/fazo96/homework.git synced 2025-01-09 12:10:08 +01:00

added some API docs and ability to disable API Key gui

This commit is contained in:
Enrico Fasoli 2015-03-10 09:55:08 +01:00
parent 19850b1d20
commit 1e737a9e91
4 changed files with 16 additions and 1 deletions

View File

@ -52,6 +52,18 @@ __Example:__ `meteor --settings file.json` or `meteor deploy homework --settings
The application will automatically adapt and show login buttons as needed.
#### RESTful API
To enable the __RESTful API__ on your server, just add this to your `.json` settings file (as explained in the section above):
```json
"public": {
"enableAPI": true
}
```
Your users will now be able to set API keys and use them, also enabling the use of the [Homework Command Line Client](http://github.com/fazo96/homework-cli).
### License
The MIT License (MIT)

View File

@ -25,6 +25,7 @@ amIValid = ->
UI.registerHelper "version", -> version
UI.registerHelper "status", -> Meteor.status()
UI.registerHelper "loading", -> Meteor.loggingIn() or !Meteor.status().connected
UI.registerHelper "APIAvailable", -> Meteor.settings.public?.enableAPI?
UI.registerHelper "facebookAvailable", ->
Accounts.loginServicesConfigured() and ServiceConfiguration.configurations.find(service: "facebook").count() > 0
UI.registerHelper "twitterAvailable", ->

View File

@ -164,6 +164,7 @@
<p class="lead">Date Format</p>
<p>You can choose the format used to write and read dates in the note list</p>
<input type="text" class="form-control" id="set-date-format" placeholder="Date Format" value="{{dateformat}}">
{{#if APIAvailable}}
<hr>
<p class="lead">API Key</p>
<p>If you want to be able to use our <b>RESTful API</b> or an application that uses it (such as our awesome
@ -172,6 +173,7 @@
<p>you can change this key any time
or remove it completely by leaving this field blank.</p>
<input type="text" class="form-control" id="set-api-key" placeholder="Your API Key" value="{{apikey}}">
{{/if}}
<div class="btn-group">
<button type="button" id="save-settings" class="btn btn-primary">
<i class="fa fa-upload"></i> Save</button>

View File

@ -1,6 +1,6 @@
notes = share.notes = new Mongo.Collection 'notes'
if !Meteor.settings.enableAPI? then return
if !Meteor.settings.public?.enableAPI? then return
console.log 'RESTful HTTP API enabled'