From f144006daea838f3095880444d48e2941447e4e7 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Wed, 13 Dec 2023 09:33:47 +0100 Subject: Add some API methods --- public/gallery.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'public') diff --git a/public/gallery.js b/public/gallery.js index ccacec3..1935220 100644 --- a/public/gallery.js +++ b/public/gallery.js @@ -1 +1,33 @@ 'use strict' + +function call(method, params) { + return m.request({ + method: "POST", + url: `/api/{method}`, + body: params, + }) +} + +let Browse = { + view: vnode => { + return m('') + }, +} + +let View = { + view: vnode => { + return m('') + }, +} + +window.addEventListener('load', () => { + m.route(document.body, "/browse/", { + "/browse/:path": Browse, + "/view/:sha1": View, + + "/similar/:sha1": undefined, + "/tags": undefined, + "/tags/:space": undefined, + "/tags/:space/:tag": undefined, + }) +}) -- cgit v1.2.3-70-g09d2