Hacker News new | ask | show | jobs
by fud101 1265 days ago
it takes like 6 lines of code to have a working flask endpoint to deploy a quick and dirty API. About a billion files for phoenix. I hate that too.
3 comments

Phoenix by definition assumes your projects will take longer than an afternoon. :)

If you want a quick and dirty API, using Plug directly may be an option: https://gist.github.com/josevalim/fbfc669aa6087c5b79402b399d...

It comes down to whether you want to maintain a bunch of auto generated files which will never be automatically updated. I would rather maintain only the lines of code I write not ones that were generated by some tool and then immediately became legacy.
You beat me to the submit button by a minute.
I understand that generator is for education purpose. New comers might find it's cumbersome to get start if generators are absent. However, I think it should be just some guide docs. Generated context can mislead the concept of how to use the context itself. It's easy to quickly write a dirty API in phoenix, but practice guides lead to ceremony.
To be fair you could use Plug and Plug.Router directly and get almost the same line count as a flask app.

https://hexdocs.pm/plug/Plug.Router.html