Permalink
Browse files

Started working on the "Setting up the MongoDB Extension" section

  • Loading branch information...
1 parent c8f581f commit 02e4feffe3cdb3a32eb1508d83330be375b1dfa4 @Palmik committed Apr 20, 2011
Showing with 14 additions and 4 deletions.
  1. +14 −4 TUTORIAL.md
View
@@ -62,14 +62,20 @@ Our view resides in the [`resources/templates`](resources/templates) directory.
In Snap & Heist terms, the view consists of the Heist templates where we call the controller's splices.
## Down to Bussines
+### Setting up MongoDB server
+
+### Setting up the Heist Extension
+
+*Working file: [Application.hs](src/Application.hs)*
+
### Setting up the MongoDB Extension
+*Working file: [Application.hs](src/Application.hs)*
+
The Snap.Extension.MongoDB is Snap extension utilizing Snap's extension interface.
It's installed analogicaly to any other Snap's extension.
-In the [Application.hs](src/Application.hs):
-
-First, we import the module:
+First, we import the module of the extension:
import Snap.Extension.DB.MongoDB
@@ -90,4 +96,8 @@ And finally call the extension's initializer in the application's initializer:
applicationInitializer = do
heist <- heistInitializer "resources/templates"
database <- mongoDBInitializer (Host "127.0.0.1" $ PortNumber 27017) 1 "pastie"
- return $ ApplicationState heist database
+ return $ ApplicationState heist database
+
+ database <- mongoDBInitializer (Host "127.0.0.1" $ PortNumber 27017) 1 "pastie"
+
+That line tells the MongoDB extension, that the database server is hosted on `127.0.0.1` and listening on port `27017` (which is the standard one)

0 comments on commit 02e4fef

Please sign in to comment.