alxchoy
How to create local server
Hi everybody,
I’m new in this programming language, my question is about create a simple http server.
For example in golang or nodeJs, I only need use owner http modules but in elixir I need cowboy? Plug? Potion?. I was reading about GenServer i don’t know if this is the answer. Thank for help me.
Sry but I’m not native speaker.
Most Liked Responses
hauleth
There is built in module httpd which provides very, very simple HTTP server. Think of it like Ruby’s WEBrick or Python’s http.server modules. This is very, very simple server that is not suitable for “real world” usage. On the other hand Cowboy, Raxx, Elli and others are much more powerful implementations with a lot of different features that can handle heavy loads, do pooling, proper error handling, etc.
Of course you can implement your own server on top of gen_tcp (with or without ssl module), but it would be NIH syndrome (unless you know what you are doing).
But if you want something that is super simple - plug and play - server, then you can use raw Plug directly. RN it has support only for Cowboy, but it is pretty solid implementation that will probably fit your use case in 100%. But nothing prevents you from using Cowboy directly.
kokolegorille
pdgonzalez872
Welcome @alxchoy!
Here is a great intro to Plug: https://elixirschool.com/en/lessons/specifics/plug/, a way of creating a minimal webserver.
For anything else, I’d strongly suggest looking at Phoenix: Up and Running — Phoenix v1.8.8
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
- #javascript
- #code-sync
- #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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








