diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-12-13 09:33:47 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-12-13 11:56:27 +0100 |
commit | f144006daea838f3095880444d48e2941447e4e7 (patch) | |
tree | 00d6ced5702337e55063a32fdaf7e4c04d9348f8 /public/gallery.js | |
parent | 286b43d1733e00c49e6246669896cde0340f990b (diff) | |
download | gallery-f144006daea838f3095880444d48e2941447e4e7.tar.gz gallery-f144006daea838f3095880444d48e2941447e4e7.tar.xz gallery-f144006daea838f3095880444d48e2941447e4e7.zip |
Add some API methods
Diffstat (limited to 'public/gallery.js')
-rw-r--r-- | public/gallery.js | 32 |
1 files changed, 32 insertions, 0 deletions
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, + }) +}) |