beginning work on docs

This commit is contained in:
Paul Liverman III 2018-04-24 20:55:12 -07:00
parent 5e6b5ac9a2
commit 0e52a5e936
4 changed files with 28 additions and 11 deletions

View File

@ -14,6 +14,7 @@ class Simplex extends Application
@include locate "users"
@include locate "api"
@include locate "docs"
-- TODO intentionally cause an error to see if this is working as intended
handle_error: (err, trace) =>

View File

@ -157,13 +157,3 @@ class API extends Application
return json: { success: true }
else
abort 500, "Error deleting api_key."
-- /new { content: "string" }
-- /do { id: # } or content
-- /undo { id: # } or content
-- /get { id: # } or content
-- /random { count: #, done: bool } (both args optional, defaults count 1, done false)
-- /list { count: #, done: bool, page: #, order: asc/desc } (if done not specified, returns all,
-- default count is 50, default page is 1, default order is latest first
-- /key/new
-- /key/delete { id: #, key: "str" }

26
applications/docs.moon Normal file
View File

@ -0,0 +1,26 @@
import Application from require "lapis"
class Docs extends Application
@path: "/docs"
@name: "docs_"
[index: ""]: =>
@html ->
h3 "Hi there."
a href: @url_for("docs_v1"), "click here"
[v1: "/v1"]: =>
@html ->
p "ToDo. Write this."
-- /new { content: "string" }
-- /get { id: # } or content
-- /do { id: # } or content
-- /undo { id: # } or content
-- /delete { id: # } or content
-- /random { count: #, done: bool } (both args optional, defaults count 1, done false)
-- /list { count: #, done: bool, page: #, order: asc/desc } (if done not specified, returns all,
-- default count is 50, default page is 1, default order is latest first
-- /key/new
-- /key/delete { id: #, key: "str" }

View File

@ -23,7 +23,7 @@ class extends Widget
div class: "container", ->
div class: "row", ->
div class: "column column-25 btns", ->
a class: "button", href: "#", "API Docs"
a class: "button", href: @url_for("docs_v1"), "API Docs"
div class: "column column-100", ->
h1(@title or "Simplex")
div class: "column column-25 btns", ->