-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,18 @@ | ||
# clj-web | ||
|
||
- [part 1: basic web](doc/clj-web-from-the-ground-up-1.md) | ||
- [part 2: compojure](doc/clj-web-from-the-ground-up-2.md) | ||
- [part 2: routing with compojure](doc/clj-web-from-the-ground-up-2.md) | ||
- [part 3: component & reloadable workflow](doc/clj-web-from-the-ground-up-3.md) | ||
- [part 4: db](doc/clj-web-from-the-ground-up-4.md) | ||
- [part 5: config](doc/clj-web-from-the-ground-up-5.md) | ||
- [part 6: api](doc/clj-web-from-the-ground-up-6.md) | ||
- [part 7: logging](doc/clj-web-from-the-ground-up-7.md) | ||
- [part 8: test](doc/clj-web-from-the-ground-up-8.md) | ||
- [part 7: spec](doc/clj-web-from-the-ground-up-7.md) | ||
- [part 8: logging](doc/clj-web-from-the-ground-up-8.md) | ||
- [part 9: test](doc/clj-web-from-the-ground-up-9.md) | ||
|
||
## Installation | ||
## Development | ||
|
||
Download from http://example.com/FIXME. | ||
$ lein repl | ||
(init/start/stop/reset) | ||
|
||
## Usage | ||
|
||
FIXME: explanation | ||
|
||
$ java -jar clj-web-0.1.0-standalone.jar [args] | ||
|
||
## Options | ||
|
||
FIXME: listing of options this app accepts. | ||
|
||
## Examples | ||
|
||
... | ||
|
||
### Bugs | ||
|
||
... | ||
|
||
### Any Other Sections | ||
### That You Think | ||
### Might be Useful | ||
|
||
## License | ||
|
||
Copyright © 2019 FIXME | ||
|
||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License 2.0 which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
|
||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the Eclipse | ||
Public License, v. 2.0 are satisfied: GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or (at your | ||
option) any later version, with the GNU Classpath Exception which is available | ||
at https://www.gnu.org/software/classpath/license.html. | ||
Access the app at http://localhost:3000/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
(ns clj-web.handler.foo | ||
(:require [clojure.tools.logging :as log] | ||
[clj-web.db.foo :as foo-db] | ||
[ring.util.http-response :refer :all])) | ||
[ring.util.http-response :refer :all] | ||
[clojure.spec.alpha :as s] | ||
[clj-web.handler.spec :as hs])) | ||
|
||
(defn bar [req db] | ||
(log/debug req) | ||
(ok (foo-db/bar db))) | ||
|
||
(defn data [body] | ||
(if (s/valid? ::hs/data-request body) | ||
(ok (s/conform ::hs/data-request body)) | ||
(bad-request (s/explain-str ::hs/data-request body)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(ns clj-web.handler.spec | ||
(:require [clojure.spec.alpha :as s])) | ||
|
||
(s/def ::first-name string?) | ||
(s/def ::last-name string?) | ||
(s/def ::phone string?) | ||
|
||
(s/def ::data-request | ||
(s/keys :req-un [::first-name ::last-name] | ||
:opt-un [::phone])) |