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

Improvement suggestion for the default template #76

Open
oz123 opened this issue Oct 8, 2020 · 3 comments
Open

Improvement suggestion for the default template #76

oz123 opened this issue Oct 8, 2020 · 3 comments

Comments

@oz123
Copy link
Contributor

oz123 commented Oct 8, 2020

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?

@swlkr
Copy link
Collaborator

swlkr commented Oct 8, 2020

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

@oz123
Copy link
Contributor Author

oz123 commented Oct 9, 2020

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]))

@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?

@swlkr
Copy link
Collaborator

swlkr commented Oct 14, 2020

Yeah! Open up a PR and we can get it merged

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

No branches or pull requests

2 participants