Skip to content
Permalink
Browse files

Corrected the README, it’s start!, not run.

  • Loading branch information...
pupeno committed Dec 13, 2015
1 parent 526fdb3 commit be25597ce2eb96f450af1086fa999ddaafd3e068
Showing with 8 additions and 8 deletions.
  1. +8 −8 README.md
@@ -117,24 +117,24 @@ Most likely you want to keep the JavaScript engine in an atom:
```clojure
(def js-engine (atom nil))
(reset! js-engine (prerenderer/run {:path "target/js/server-side.js"})))
(reset! js-engine (prerenderer/start! {:path "target/js/server-side.js"})))
```
When you run Prerenderer like that, if `target/js/server-side.js` is not present, it'll raise an exception. You can tell
it to wait for it to appear, useful in development mode, by passing the attribute `:wait`:
```clojure
(reset! js-engine (prerenderer/run {:path "target/js/server-side.js"
:wait true})))
(reset! js-engine (prerenderer/start! {:path "target/js/server-side.js"
:wait true})))
```
If your JavaScript app runs AJAX requests with relative paths (very common) such as `GET /users`, the app will make the
request to `localhost:3000`. You can define both of this by passing `:default-ajax-host` and `:default-ajax-port`:
```clojure
(reset! js-engine (prerenderer/run {:path "target/js/server-side.js"
:default-ajax-host "192.168.1.1"
:default-ajax-port 12345})))
(reset! js-engine (prerenderer/start! {:path "target/js/server-side.js"
:default-ajax-host "192.168.1.1"
:default-ajax-port 12345})))
```
For an actual example of this, look at [Ninja Tool's core.clj, around line 23](https://github.com/carouselapps/ninjatools/blob/master/src/clj/ninjatools/core.clj#L23).
@@ -143,8 +143,8 @@ You want them to point to where the Clojure server is running. In many cases for
Also, you may want to specify the working directory for the Node.js process like this:
```clojure
(reset! js-engine (prerenderer/run {:path "js/server-side.js"
:working-directory "target"})))
(reset! js-engine (prerenderer/start! {:path "js/server-side.js"
:working-directory "target"})))
```
After that, prerendering happens by simply doing:

0 comments on commit be25597

Please sign in to comment.
You can’t perform that action at this time.