diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-10-08 23:39:37 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-10-08 23:39:37 +0200 |
commit | 2384b30a244c7d6477e54de5385fe7f1cc62d43a (patch) | |
tree | 55c9f82f9475249a7f91ac44e408e04e9f1c9560 /org-roam-ui.el | |
parent | fd4edbd6a854275c10c5b21173f0875921d547d1 (diff) |
feat(preview): proper file preview with api routing
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r-- | org-roam-ui.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el index 0fbcf5e..2d10abb 100644 --- a/org-roam-ui.el +++ b/org-roam-ui.el @@ -237,10 +237,15 @@ This serves the web-build and API over HTTP." (json-encode `((type . "orgText") (data . ,text)))))) (defservlet* note/:id text/plain () - (let* ((node (org-roam-populate (org-roam-node-create :id id))) + (if-let ((node (org-roam-populate (org-roam-node-create :id id))) (file (org-roam-node-file node))) - (insert-file-contents-literally file) -(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*"))) + (progn + (insert-file-contents-literally file) + (message "we got one %s" file) + )) +(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*")) + ;(insert "error") + ;(httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*") (defun org-roam-ui--on-save () |