joy
joy copied to clipboard
Improvement suggestion for the default template
First, let me say thanks! I just started with joy and it is a joy! I saw you also created a nice testing framework. How about adding a simple test case to the default template to encourage people to write tests and also demonstrate the framework?
Yeah, what's funny is I had a sample test in there that just called app
and checked for a success response but I took it out.
Not sure why now that I think about it.
It's time to put it back in though, I agree
A few more suggestions:
- Add a JSON API end point to the routes (in
main.janet
):
(defn api [request]
(application/json {:you-found "joy"})
)
...
(def routes (routes [:get "/" home] [:get "/api" api]))
- Add a test case which uses https://github.com/joy-framework/http to check that the API works. ~~I can add the first suggestion. For the second one I need some help ...~~
@swlkr I figured out how to use http (it's pretty awesome that this is simply syntactic sugar on top of curl). Would like me to send a PR with my suggestions?
Yeah! Open up a PR and we can get it merged