@@ -8,3 +8,38 @@ the core code lives in
8
8
For the yesod executable, see [ yesod-bin] ( http://www.stackage.org/package/yesod-bin/ ) .
9
9
10
10
Yesod is [ fully documented on its website] ( http://www.yesodweb.com/ ) .
11
+
12
+ ## Getting Started
13
+
14
+ Learn more about Yesod on [ its main website] ( http://www.yesodweb.com/ ) . If you
15
+ want to get started using Yesod, we strongly recommend the [ quick start
16
+ guide] ( http://www.yesodweb.com/page/quickstart ) , based on [ the Haskell build
17
+ tool stack] ( https://github.com/commercialhaskell/stack#readme ) .
18
+
19
+ Here's a minimal example!
20
+
21
+ ``` haskell
22
+ {-# LANGUAGE OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies #-}
23
+
24
+ import Yesod
25
+
26
+ data App = App -- Put your config, database connection pool, etc. in here.
27
+
28
+ -- Derive routes and instances for App.
29
+ mkYesod " App" [parseRoutes |
30
+ / HomeR GET
31
+ |]
32
+
33
+ instance Yesod App -- Methods in here can be overridden as needed.
34
+
35
+ -- The handler for the GET request at /, corresponds to HomeR.
36
+ getHomeR :: Handler Html
37
+ getHomeR = defaultLayout [whamlet |Hello World!|]
38
+
39
+ main :: IO ()
40
+ main = warp 3000 App
41
+ ```
42
+
43
+ To read about each of the concepts in use above (routing, handlers,
44
+ linking, JSON), in detail, visit
45
+ [ Basics in the Yesod book] ( https://www.yesodweb.com/book/basics#basics_routing ) .
0 commit comments