Skip to content

Commit

Permalink
Add a footer and basic content for all chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel Welsh committed Nov 29, 2011
1 parent 064806d commit 1ade36a
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 55 deletions.
40 changes: 31 additions & 9 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
max-width: 720px;
}

.footer {
background-color: #eee;
min-width: 940px;
padding: 30px 0;
text-shadow: 0 1px 0 #fff;
border-top: 1px solid #e5e5e5;
-webkit-box-shadow: inset 0 5px 15px rgba(0,0,0,.025);
-moz-box-shadow: inset 0 5px 15px rgba(0,0,0,.025);
box-shadow: inset 0 5px 15px rgba(0,0,0,.025);
}

.footer p {
color: #555;
}

code, pre {
line-height: 1.5;
}
Expand All @@ -40,15 +55,15 @@
<h5>Contents</h5>
<ul>
<li><a href="/intro.html">Quick Start</a></li>
<li><a href="#">Request Handlers</a></li>
<li><a href="#">Running Services</a></li>
<li><a href="#">Concurrency</a></li>
<li><a href="#">Consuming Services</a></li>
<li><a href="#">Testing</a></li>
<li><a href="#">Mongo</a></li>
<li><a href="#">JSON</a></li>
<li><a href="#">Streaming Requests and Responses</a></li>
<li><a href="#">Deployment</a></li>
<li><a href="/request-handlers.html">Request Handlers</a></li>
<li><a href="/running.html">Running Services</a></li>
<li><a href="/concurrency.html">Concurrency</a></li>
<li><a href="/http-client.html">Consuming Services</a></li>
<li><a href="/testing.html">Testing Services</a></li>
<li><a href="/json.html">Manipulating JSON</a></li>
<li><a href="/mongo.html">Working with Mongo</a></li>
<li><a href="/streaming.html">Streaming Requests and Responses</a></li>
<li><a href="/deployment.html">Deployment</a></li>
</ul>
</div>
</div>
Expand All @@ -58,5 +73,12 @@ <h1>{{ page.title }}</h1>
{{ content }}
</div>
</div>

<footer class="footer">
<div class="container">
<p class="pull-right"><a href="#">Back to top</a></p>
<p>Copyright Noel Welsh. Licensed under the Creative Commons Attribution Non-commercial.</p>
</div>
</footer>
</body>
</html>
5 changes: 4 additions & 1 deletion deployment.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Deploying BlueEyes Applications
---
layout: page
title: Deploying Services in Production
---

At some point you'll want to move your BlueEyes application to a live environment. Creating a `JAR` file containing the code and all it's dependencies is the simplest way to do this. Then you can just run

Expand Down
5 changes: 5 additions & 0 deletions http-client.md → http-client.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: page
title: Consuming REST Services
---

# HTTP Client

BlueEyes includes a full-featured HTTP client, which you'll use for interacting with other services as well as testing your own services.
23 changes: 2 additions & 21 deletions index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,7 @@ This short book describes [BlueEyes](https://github.com/jdegoes/blueeyes), a sim
- you want to leverage Scala's type system to catch errors at compile time.
- you want fast development, a quick testing cycle, and simple deployment.

This book should provide everything you need to develop in BlueEyes and deploy to production environments using many machines.

## Table of Contents
I assume you know how to use Scala, and are comfortable with your development environment of choice. Certain aspects of this book, such as the section on deployment, go beyond pure software development. When I discuss build systems, I give examples for SBT. When discussing system administration I assume a Unix-like system.

- [A quick introduction to BlueEyes](intro.html), in which we build a basic web service.
- [More on services](services.html)
- Bijections and content types
- Request parsing combinators
- HttpRequestHandler types
- Configuration
- Augmenting services (health monitor, logging, etc.)
- Manipulating JSON
- Constructing JSON using the DSL
- Extracting elements from JSON
- JSON data type representation
- Mongo integration
- Comet
- Http Client
- Testing
- Deployment
- OneJar
- RSync
- HAProxy
- Concurrency in BlueEyes
10 changes: 10 additions & 0 deletions intro.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ object CalculatorServer extends BlueEyesServer with CalculatorService

A server has `start` and `stop` methods, and a `main` method. By default the `main` method takes a `--configFile` command line option, specifying a file containing configuration parameters. Since our service has no configuration you can simply create an empty file and pass that on the command line.

## Running A Server

Most environments provide some way to run a class with a `main` method. You can use this to test your server. For example, from within `sbt` you issue the command

{% highlight bash %}
> run CalculatorService /path/to/test.config
{% endhighlight %}

In a [later section]("running.html") we'll talk about how to package your complete service into one JAR file that you can upload to a production server.

## Next Steps

We've build a complete service, showing the basic elements of using BlueEyes. The complete code for this example service is available [here](calculator-service)
Expand Down
2 changes: 1 addition & 1 deletion mongo.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
title: BlueEyes' Mongo Integration
title: Working with Mongo
---

## Mongo Integration
Expand Down
16 changes: 10 additions & 6 deletions plan.org
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#+TITLE: The Lowdown on BlueEyes
* TODO Introduction
TODO: running a service
* Building Request Handlers
- Request parsing combinators
- The HttpRequestHandler types
- Bijections
* TODO Formatting
- Links in about page
- License on page.html
- Fix sizing of content
* TODO Introduction`
- Tests for calculator app
* TODO Building Request Handlers
+ Request parsing combinators
+ The HttpRequestHandler types
+ Bijections
* Running Services
- Configuration
- Config file format
Expand Down
19 changes: 3 additions & 16 deletions services.markdown → request-handlers.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
title: Building Services
title: Building Request Handlers
---

In the [introduction](intro.html) we saw the basics of constructing REST services in BlueEyes.
Expand All @@ -20,19 +20,6 @@ To access these import `blueeyes.core.http.MimeTypes._`

The common HTTP request methods `get`, `post`, `put`, and `head`, as well as less common (nonstandard?) methods `delete`, `patch`, `options`, `trace`, and `connect` are specified as combinators.

## The HttpRequestHandler Types


## Configuration

Configuation is done via the context passed to service. This context (an instance of `blueeyes.core.service.HttpServiceContext`) has a attribute called `config` which is an instance of a [Configgy](https://github.com/robey/configgy) `ConfigMap`.

You can pass in a `--configFile` option on the command line, or construct a `ConfigMap` in code:

{% highlight scala %}
import net.lag.configgy.Configgy

Configgy.configure("/etc/my-service.conf")
val config = Configgy.config
{% endhighlight %}


## Bijections
7 changes: 6 additions & 1 deletion testing.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Testing BlueEyes Services
---
layout: page
title: Testing BlueEyes Services
---

BlueEyes provides some custom additions to the `Specs` testing framework to allow you to easily test services. At the time of writing the current BlueEyes release (the 0.4 series) supports `Specs`. The next major release (0.5) will support `Specs 2`.

BlueEyes testing framework supports `Specs`, so the first thing is to add that to your project:

Expand Down

0 comments on commit 1ade36a

Please sign in to comment.