Last active
August 29, 2015 14:27
-
-
Save up1/e00ab22b9e4bf06e8b06 to your computer and use it in GitHub Desktop.
Demo :: Web framework on JVM
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
(ns hello-world.handler | |
(:require [compojure.core :refer :all] | |
[compojure.route :as route] | |
[ring.middleware.defaults :refer [wrap-defaults site-defaults]])) | |
(defroutes app-routes | |
(GET "/" [] "Hello World") | |
(route/not-found "Not Found")) | |
(def app | |
(wrap-defaults app-routes site-defaults)) |
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
import org.scalatra._ | |
import scalate.ScalateSupport | |
class HelloServlet extends HelloStack { | |
get("/") { | |
<html> | |
<body> | |
<h1>Hello, world!</h1> | |
Say <a href="hello-scalate">hello to Scalate</a>. | |
</body> | |
</html> | |
} | |
} |
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
import static spark.Spark.get; | |
public class HelloSpark { | |
public static void main(String[] args) { | |
get("/hello", (req, res) -> "Hello World"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment