Permalink
Browse files

Update the README and add a terrible homepage for the web

  • Loading branch information...
1 parent bc44175 commit 7304d98815f64e87f0f1b27457184c34181ca8eb @kyleconroy kyleconroy committed Apr 6, 2012
Showing with 43 additions and 5 deletions.
  1. +15 −4 README.md
  2. +28 −1 web.py
View
@@ -1,22 +1,33 @@
# GitLicense
-REST API for what license a project is under
+REST API for discovering the license for a github repository.
-## Algorithm
+## Usage
-The current algorithm is really simple. I look for a `LICENSE` or `LICENSE.*` file, and see if it matches any of the licenses I support.
+ curl -i http://gitlicense.herokuapp.com/:user/:repo
+
+The return value will be a JSON object of the following form.
+
+ {
+ repo: ":user",
+ user: ":repo",
+ license: "MIT License"
+ }
### Supported Licenses
* MIT license (MIT)
* ISC License (ISC)
* Apache License 2.0 (Apache-2.0)
+* GNU General Public License, version 2 (GPL-2.0)
* GNU General Public License, version 3 (GPL-3.0)
* GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL-3.0)
* BSD License
+* Modified BSD License
+* Artisitic License 2.0
+* Mozilla Public License
## TODO
* Improve the license matching algorithm
-* Support more licenses
View
29 web.py
@@ -1,4 +1,4 @@
-from flask import Flask, jsonify, abort
+from flask import Flask, jsonify, abort, make_response
import os
import requests
import json
@@ -172,6 +172,33 @@ def get_license(user, repo_name):
app = Flask(__name__)
+@app.route("/")
+def index():
+ index = """
+<!DOCTYPE html>
+<html>
+ <body>
+ <pre>
+# GitLicense
+
+REST API for discovering the license for a github repository.
+
+## Usage
+
+ curl -i http://gitlicense.herokuapp.com/:user/:repo
+
+The return value will be a JSON object of the following form.
+
+ {
+ repo: ":user",
+ user: ":repo",
+ license: "MIT License"
+ }
+ </pre>
+ </body>
+</html>"""
+ return make_response(index)
+
@app.route("/<user>/<repo>")
def index_with_url(user, repo):
try:

0 comments on commit 7304d98

Please sign in to comment.