Permalink
Browse files

updated examples and README

  • Loading branch information...
1 parent 12b806b commit 799b46421b7473080662a5a4d3a1c816403b39d7 @nrstott committed Nov 4, 2010
View
@@ -1,6 +1,10 @@
## Getting Started
-* Install nodules (npm install nodules)
+Bogart can be installed via npm
+ npm install bogart
+
+Alternatively, clone the git repository
+ git clone git://github.com/nrstott/bogart.git
## Hello World in Bogart
@@ -34,11 +38,57 @@ Create the following two files:
}
}
-Start your app: `nodules app.js`
+Start your app: `node app.js`
Visit it in a web browser at [http://localhost:8080](http://localhost:8080).
Visit the route that says hello to you by name at [http://localhost:8080/bob](http://localhost:8080/bob)
+## Running the Examples
+
+In the 'examples' directory of the cloned source, there are several examples of bogart applications.
+
+### Hello World
+
+The hello world example demonstrates a basic bogart applications. The application has a route, /hello, that takes a name
+as a parameter in the request URL. The application responds with 'hello <name>'
+
+ > cd examples
+ > node hello-world.js
+
+Visit the application in your web browser at [http://localhost:8080/hello/jim](http://localhost:8080/hello/jim)
+
+### Mustache Template with Layout
+
+This example demonstrates usage of the mustache templating engine and a mustache layout. A layout is a page designed
+to hold other templates to avoid duplication of content.
+
+ > cd examples/mustache-layout
+ > node app.js
+
+Visit the application in a web browser at [http://localhost:8080/](http://localhost:8080)
+
+### Haml
+
+Haml is an optional dependency of bogart. Please install it via `npm install haml` if you wish to use this templating
+engine.
+
+The Haml sample demonstrates a haml view without a layout.
+
+ > cd examples/haml-view
+ > node app.js
+
+Visit the application in a web browser at [http://localhost:8080/](http://localhost:8080)
+
+### Serve Static Files
+
+The static example demonstrates using bogarts *Directory* middleware to serve an image.
+
+ > cd examples/static-server
+ > node app.js
+
+Visit the application in a web browser at [http://localhost:8080/](http://localhost:8080).
+You should see the image.
+
## Inspirations
* [Sinatra](http://www.sinatrarb.com/)
File renamed without changes.
@@ -0,0 +1,13 @@
+{
+ "name": "haml-example",
+ "version": "1.0.0",
+ "author": "Nathan Stott",
+ "email": "nathan.stott@whiteboard-it.com",
+ "main": "./app.js",
+ "directories": { "lib": "./lib" },
+ "dependencies": {
+ "promised-io": "v0.2.1",
+ "jsgi": "v0.2.2",
+ "mustache": "0.3.1-dev"
+ }
+}
@@ -1,13 +1,13 @@
{
- "name": "bogart",
- "description": "Fast JSGI web framework taking inspiration from Sinatra",
- "version": "0.0.3",
- "keywords": ["bogart", "framework", "sinatra", "REST"],
+ "name": "mustache-layout-example",
+ "version": "1.0.0",
"author": "Nathan Stott",
"email": "nathan.stott@whiteboard-it.com",
- "main": "./lib/bogart",
+ "main": "./app.js",
"directories": { "lib": "./lib" },
- "mappings": {
- "promised-io": "jar:http://github.com/kriszyp/promised-io/zipball/master!/lib/"
+ "dependencies": {
+ "promised-io": "v0.2.1",
+ "jsgi": "v0.2.2",
+ "mustache": "0.3.1-dev"
}
}
@@ -1,11 +1,13 @@
{
- "name": "bogart-static-server-example",
- "description": "Fast JSGI web framework taking inspiration from Sinatra",
+ "name": "static-server-example",
+ "version": "1.0.0",
"author": "Nathan Stott",
"email": "nathan.stott@whiteboard-it.com",
- "main": "./lib/app",
+ "main": "./app.js",
"directories": { "lib": "./lib" },
- "mappings": {
- "promised-io": "jar:http://github.com/kriszyp/promised-io/zipball/master!/lib/"
+ "dependencies": {
+ "promised-io": "v0.2.1",
+ "jsgi": "v0.2.2",
+ "mustache": "0.3.1-dev"
}
}

0 comments on commit 799b464

Please sign in to comment.