-
Notifications
You must be signed in to change notification settings - Fork 15
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
[PR] Adding API #60
[PR] Adding API #60
Conversation
Still very much in-progress but should be manageable.
But none were really useful. I really wanted a way of keeping the code clean to simply return a JSON object using Postman. I came across elixir-ecto/ecto#1348 but it was an old issue and didn't really seem the idiomatic way of doing things (even if José gave the answer). Using Came across https://alchemist.camp/episodes/encoding-ecto-structs-poison and it was it (though not at first). The answer was having to add the This only works because # Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason |
The API routes work under the "/api" scope, as per Phoenix 1.7rc's guide and recommendation. (even though we could use content negotiation, I personally don't see a problem with this path and it makes it simpler for the users). I'm going to update the readme after standup. |
Finished adding tests. They aren't 100% but they technically are. The missing lines are already covered on #56. Since this PR was created with If this PR is merged into |
Codecov Report
@@ Coverage Diff @@
## main #60 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 9 +1
Lines 66 91 +25
=========================================
+ Hits 66 91 +25
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Just added tests, a guide and referred it in the main readme. |
@LuchoTurtle please tidy the |
@nelsonic should be sorted. 👍 |
Thanks for fixing the |
Compiling 22 files (.ex)
warning: router paths should begin with a forward slash, got: "items"
(phoenix 1.7.0-rc.0) lib/phoenix/router/scope.ex:113: Phoenix.Router.Scope.validate_path/1
(phoenix 1.7.0-rc.0) lib/phoenix/router/resource.ex:31: Phoenix.Router.Resource.build/3
lib/app_web/router.ex:35: (module)
(elixir 1.14.1) src/elixir_compiler.erl:65: :elixir_compiler.dispatch/4
(elixir 1.14.1) src/elixir_compiler.erl:50: :elixir_compiler.compile/3
(elixir 1.14.1) src/elixir_module.erl:379: :elixir_module.eval_form/6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great additions; thanks @LuchoTurtle! 🎉
closes #53
This PR adds the ability for users to interact with Phoenix as an API. It should: