GET https://example.com/users?offset=0&limit=10
This file contains hidden or 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
(ns pipeline.core | |
(:require [compojure.core :refer [POST defroutes]] | |
[ring.middleware.json :refer [wrap-json-response wrap-json-body]] | |
[ring.util.response :refer [response]]) | |
(:gen-class)) | |
(defn post-notes-handler | |
[req-body] | |
(response req-body)) |
This file contains hidden or 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
curl \ | |
-H "Content-Type: application/json" \ | |
-d '{"text":"xyz"}' \ | |
http://localhost:3000/notes | |
RESPONSE: {"text":"xyz"} |
This file contains hidden or 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
(ns pipeline.core | |
(:require [compojure.core :refer [POST defroutes]] | |
[ring.util.response :refer [response]])) | |
(defn post-notes-handler | |
[req-body] | |
(response req-body)) | |
(defroutes app | |
(POST "/notes" {req-body :body} (post-notes-handler req-body))) |
This file contains hidden or 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
application input: HttpInput (HTTP request body) | |
| | |
| | |
+--> post-notes-handler: HttpInput (returns what it's passed) | |
| | |
| | |
+--> response: Hash Map (a shell HTTP response) | |
| | |
| | |
+--> application output |
This file contains hidden or 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
application input: HttpInput (HTTP request body) | |
| | |
| | |
+--> wrap-json-body: Hash Map (deserialized from JSON) | |
| | |
| | |
+--> post-notes-handler: Hash Map (returns what it's been passed) | |
| | |
| | |
+--> response: Hash Map (a shell HTTP response) |
This file contains hidden or 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
application input: HttpInput (HTTP request body) | |
| | |
| | |
+--> wrap-json-body: Hash Map | |
| | |
| | |
+--> post-notes-handler: Hash Map | |
| | |
| | |
+--> validate-note: [Hash Map, Error String] (present? correct length?) |
This file contains hidden or 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
application input: HttpInput (HTTP request body) | |
| | |
| | |
+--> wrap-json-body: Hash Map | |
| | |
| | |
+--> post-notes-handler: Hash Map | |
| | |
| | |
+--> validate-note: [Hash Map, Error String] |
This file contains hidden or 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
export DATABASE_URL="postgres://psql@localhost:5432/soundselect" | |
export BONSAI_URL=http://localhost:9200 | |
export TZ='UTC' | |
export RBSS_HEAPDUMP_INTERVAL=5 |
This file contains hidden or 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
RAILS_ENV=test bundle exec rake db:drop db:create | |
echo '\x \\ DROP EXTENSION postgis CASCADE;' | psql zzz_test | |
echo '\x \\ CREATE EXTENSION postgis;' | psql zzz_test | |
RAILS_ENV=test rake db:schema:load | |
bundle exec rspec spec/queries/listings_query_spec.rb:131 | |
git stash |