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

Allow to return primitive data structures in fun #32

Closed
tank-bohr opened this issue Nov 20, 2018 · 0 comments · Fixed by #33
Closed

Allow to return primitive data structures in fun #32

tank-bohr opened this issue Nov 20, 2018 · 0 comments · Fixed by #33
Labels
enhancement New feature or request

Comments

@tank-bohr
Copy link
Owner

What I've done

bookish_spork:stub_request(fun(Request) ->
    case bookish_spork_request:uri(Request) of
        "/bookish/spork" ->
            [200, [], <<"Hello">>];
        "/admin/sporks" ->
            [403, [], <<"It is not possible here">>]
    end
end)

Actual result

  • It doesn't work
  • We have to use clumsy syntax
  • too many bookish_spork

Expected result

  • Neat concise clojure-like syntax is allowed

Environment

  • bookish_spork version is 0.2.5
@tank-bohr tank-bohr mentioned this issue Nov 20, 2018
tank-bohr pushed a commit that referenced this issue Nov 20, 2018
- Expand `bookish_spork_response:new/1` interface
- Allow headers as map and as proplist in `bookish_spork_response:new/1`
- Minor documentation changes
@tank-bohr tank-bohr added the enhancement New feature or request label Nov 20, 2018
tank-bohr pushed a commit that referenced this issue Nov 20, 2018
- Expand `bookish_spork_response:new/1` interface
- Allow headers as map and as proplist in `bookish_spork_response:new/1`
- Minor documentation changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant