Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #118

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Remember to pass ":debug nil" to turn off the debugger mode on production enviro

### Start a server

On a separate thread than the main thread:

```common-lisp
(ql:quickload :woo)

Expand All @@ -31,6 +33,37 @@ Remember to pass ":debug nil" to turn off the debugger mode on production enviro
'(200 (:content-type "text/plain") ("Hello, World"))))
```

Note the following:
- The default port is `5000`
- The above will not work in the main thread

#### To run from the REPL do this:

```common-lisp
(ql:quickload :woo)
(defvar *woo-app*
(lambda (env)
(declare (ignore env))
'(200 () ("Hello from Woo"))))

(defvar *clack-server*
(clack:clackup *woo-app*
:server :woo
;; :address "0.0.0.0"
:port 80
:debug NIL))
```

**Note:** By default the address is only `localhost`/`127.0.0.1`, if you uncomment the line above and set it to `0.0.0.0` it will accept connections from anywhere.

To stop the server do:

```common-lisp
(clack:stop *clack-server*)
```

**Note**: There is a function `(woo:run server)`, however, I don't know where we get the server variable to pass it in.

### Start with Clack

```common-lisp
Expand Down Expand Up @@ -58,7 +91,7 @@ Remember to pass ":debug nil" to turn off the debugger mode on production enviro

Use SSL key arguments of `woo:run` or `clack:clackup`.

```commonlisp
```common-lisp
(woo:run app
:ssl-cert-file #P"path/to/cert.pem"
:ssl-key-file #P"path/to/key.pem"
Expand Down