(defmodule nemoptera_router
(behaviour nova_router)
(export all))
(defun routes (_environment)
(let ((plugins (list (tuple 'pre_request 'nova_request_plugin
#M(read_urlencoded_body true parse_qs true))
(tuple 'post_request 'nova_request_plugin
#M(read_urlencoded_body true parse_qs true))))
(public
(list
(tuple "/" #'nemoptera_public:index/1 #M(methods (get)))
(tuple "/timeline" #'nemoptera_public:timeline/1 #M(methods (get)))
(tuple "/rss" #'nemoptera_public:rss/1 #M(methods (get)))
(tuple "/atom" #'nemoptera_public:atom/1 #M(methods (get)))
(tuple "/setup" #'nemoptera_setup_pages:show/1 #M(methods (get)))
(tuple "/setup" #'nemoptera_setup_pages:save/1 #M(methods (post)))
(tuple "/login" #'nemoptera_login:show/1 #M(methods (get)))
(tuple "/login" #'nemoptera_login:save/1 #M(methods (post)))
(tuple "/logout" #'nemoptera_login:logout/1 #M(methods (get)))
(tuple "/[...]" #'nemoptera_proxy:handle/1 #M(methods (get head post) extra_state #M()))))
(admin
(list
(tuple "/" #'nemoptera_admin:home/1 #M(methods (get)))
(tuple "/repos" #'nemoptera_admin:repos/1 #M(methods (get)))
(tuple "/repos/new" #'nemoptera_admin:repo-new/1 #M(methods (get)))
(tuple "/repos/new" #'nemoptera_admin:repo-create/1 #M(methods (post)))
(tuple "/repos/:id" #'nemoptera_admin:repo-edit/1 #M(methods (get)))
(tuple "/repos/:id" #'nemoptera_admin:repo-update/1 #M(methods (post)))
(tuple "/repos/:id/delete" #'nemoptera_admin:repo-delete/1 #M(methods (get)))
(tuple "/repos/:id/delete" #'nemoptera_admin:repo-delete-do/1 #M(methods (post)))
(tuple "/repos/:id/sync" #'nemoptera_admin:repo-sync/1 #M(methods (post)))
(tuple "/repos/:id/push" #'nemoptera_admin:repo-push/1 #M(methods (post)))
(tuple "/orgs" #'nemoptera_admin:orgs/1 #M(methods (get)))
(tuple "/orgs/new" #'nemoptera_admin:org-new/1 #M(methods (get)))
(tuple "/orgs/new" #'nemoptera_admin:org-create/1 #M(methods (post)))
(tuple "/orgs/:id" #'nemoptera_admin:org-edit/1 #M(methods (get)))
(tuple "/orgs/:id" #'nemoptera_admin:org-update/1 #M(methods (post)))
(tuple "/orgs/:id/delete" #'nemoptera_admin:org-delete/1 #M(methods (get)))
(tuple "/orgs/:id/delete" #'nemoptera_admin:org-delete-do/1 #M(methods (post)))
(tuple "/settings" #'nemoptera_admin:settings/1 #M(methods (get)))
(tuple "/settings" #'nemoptera_admin:settings-save/1 #M(methods (post))))))
(list
(maps:from_list
(list (tuple 'prefix "")
(tuple 'security 'false)
(tuple 'plugins plugins)
(tuple 'routes public)))
(maps:from_list
(list (tuple 'prefix "/admin")
(tuple 'security #'nemoptera_admin:auth-check/1)
(tuple 'plugins plugins)
(tuple 'routes admin))))))