Browse Source

added method to the url

master
Julio Biason 11 years ago
parent
commit
1e6cfc3b38
  1. 10
      luncho/server.py

10
luncho/server.py

@ -205,17 +205,17 @@ def show_api():
continue continue
path = str(rule) path = str(rule)
# methods = rule.methods
doc = app.view_functions[endpoint].__doc__ doc = app.view_functions[endpoint].__doc__
# make the doc a little more... pretty # make the doc a little more... pretty
summary = doc.split('\n\n')[0] summary = doc.split('\n\n')[0]
summary = ' '.join(line.strip() for line in summary.split('\n')) summary = ' '.join(line.strip() for line in summary.split('\n'))
routes.append([ for method in rule.methods:
path, routes.append([
summary rule.methods.upper() + ' ' + path,
]) summary
])
routes.sort(key=itemgetter(0)) routes.sort(key=itemgetter(0))
return jsonify(status='OK', api=routes) return jsonify(status='OK', api=routes)

Loading…
Cancel
Save