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

Add non-invasive nix shell integration #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sisyphushappy
Copy link

@sisyphushappy sisyphushappy commented Aug 17, 2022

Hi @chshersh,

I watched your FunctionalFest presentation about cake-slayer, and I think this is a great project for the Haskell community. The choices you made really seem to address a lot of the reservations I've felt about investing in Haskell for a production application. I am still a Haskell beginner so I'm hoping that by grokking this template project, I can level myself up to proficiency.

Anyway, this change is based on a Tweag blog post, which explains how to integrate Nix with stack in a non-invasive manner.

I tested the change on my NixOS machine by building...

stack build

running the server...

stack run piece-of-cake-slayer

and running the test commands from the readme...

$ curl localhost:8080/items

$ curl -XPOST \
    -H 'Content-Type: application/json' \
    localhost:8080/createItem \
    -d '{"tag": "Item", "text": "New item"}'

$ curl -XPOST \
    -H 'Content-Type: application/json' \
    localhost:8080/deleteItem \
    -d '1'

Finally, I ran the unit tests...

$ stack test
piece-of-cake-slayer> test (suite: piece-of-cake-slayer-test)
                                  

Unit tests
  Database tests
    Item
      Gets all items
      Creates new item
      Deletes item

Finished in 0.0185 seconds
3 examples, 0 failures

piece-of-cake-slayer> Test suite piece-of-cake-slayer-test passed
Completed 9 action(s).

@chshersh
Copy link
Contributor

Hi @sisyphushappy, thanks for the kind words about my talk! 😊
However, I'm not maintaining this project anymore.

@sisyphushappy
Copy link
Author

No problem, thanks anyway 🙂!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants