Created
August 22, 2013 11:25
-
-
Save mtmtcode/6306039 to your computer and use it in GitHub Desktop.
naruto.el Herokuデビュー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: tar xzf emacs.tar.gz && ln -s $PWD/emacs /tmp/emacs; emacs/bin/emacs --daemon --load start-elnode.el |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; start-elnode.el | |
(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/"))) | |
(package-initialize) | |
(package-refresh-contents) | |
(package-install 'dash) | |
(package-install 'elnode) | |
(load-file "naruto.el") | |
(defun handler (httpcon) | |
"Demonstration function" | |
(elnode-http-start httpcon "200" | |
'("Content-type" . "text/html") | |
`("Server" . ,(concat "GNU Emacs " emacs-version))) | |
(elnode-http-return httpcon (format "<html><body><pre>%s</pre></body></html>" (naruto "Heroku'(へろく)は2007年創業のアメリカ合衆国の企業。また、同社が開発と運営を行っているPaaSの名称でもある。2010年にはセールスフォース・ドットコムに買収された。")))) | |
(elnode-start | |
'handler | |
:port (string-to-number (or (getenv "PORT") "8080")) | |
:host "0.0.0.0") | |
(while t (accept-process-output nil 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment