Add ngrok command

This commit is contained in:
Jeremy Dormitzer 2019-09-15 11:12:38 -04:00
parent 4632903735
commit d93f91a0e1

View File

@ -3111,3 +3111,18 @@ A fuzzy-finder for notes.
#+BEGIN_SRC emacs-lisp
(use-package pollen-mode)
#+END_SRC
* Ngrok
#+BEGIN_SRC emacs-lisp
(defun ngrok (port &optional subdomain)
(interactive "nPort: \nsSubdomain: ")
(let ((buf (get-buffer-create
(concat "*ngrok-"
(number-to-string port)
"*")))
(cmd (if (and subdomain (not (string-empty-p subdomain)))
(concat "ngrok http "
"--subdomain=" subdomain " "
(number-to-string port))
(concat "ngrok http " (number-to-string port)))))
(async-shell-command cmd buf)))
#+END_SRC