code
Building an API
I want to transfer an API that was built using fastapi in python to elixir. Should I use phoenix or plug? Phoenix is excellent for web development, but is it overkill for an API that serves another frontend built in js? plug on the other hand seems suitable from what I’ve read but I also read that it needs more boilerplate. The API is fairly complex and plug seems suitable to me. I just wanted to know if there is anything that I should be warned about regarding plug and if there are some tweaks to phoenix to make it similar to fastapi (ie: remove the fullstack web development packages).
Thank you.
Marked As Solved
RudManusachi
Also Liked
victorbjorklund
I would say go with Phoenix unless it is a very simple API that won’t grow in the future (which does not seem to be the case). The overhead of phoenix is negligible but makes many things easier.
Just exclude everything you don’t need:
mix phx.new my_api --no-assets --no-gettext --no-html --no-mailer
code
dimitarvp
Phoenix, while making your app have a little more files, is much more future-proof than any almost barebones Plug app you might do.
Go for Phoenix. It might be slightly annoying to begin with but will very quickly pay dividends.
Last Post!
victorbjorklund
I would say go with Phoenix unless it is a very simple API that won’t grow in the future (which does not seem to be the case). The overhead of phoenix is negligible but makes many things easier.
Just exclude everything you don’t need:
mix phx.new my_api --no-assets --no-gettext --no-html --no-mailer
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










