7stud
I’m fooling around with Cowboy, and the Getting Started guide has you build the src files with:
% make run
That takes 10-20 seconds on my system. That’s pretty intolerable when trying to write code. Is there a way to avoid having to rebuild the whole thing when I edit my src files?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Most Liked- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
You might find https://erlangforums.com/ a more focused audience for your question than this one if you don’t get any resolution here.
Last Post!
7stud
Here’s the thread on EFS:
I ended up following a tutorial on setting up cowboy in a Docker container using rebar3. I’m not using a Docker container, so what I ended up with is a rebar3 app with cowboy as a dependency. Thereafter, when I execute
rebar3 shell, that starts a cowboy server and opens a shell in the terminal window. Then if I go into another terminal window and send a request to the url specified in my cowboy code, I get the expected response.Here are the steps:
In the file my_cowboy_server/
rebar.config, add cowboy as a dependency:You don’t have to add
ranchorcow_libas a dependency.In the file my_cowboy_server/
src/my_cowboy.app.srcadd cowboy to the list of applications that need to be started before your app:In the file my_cowboy_server/
src/my_cowboy_server_app.erladd your routes:Create the file my_cowboy_server/
src/hello_handler.erl:Then in one terminal window, I can execute:
and any output in my cowboy code will appear in that terminal window, for instance if I have this code:
I see:
Then I can open another terminal window and send a request to the cowboy server, for instance:
If you want/need to use the template generating capabilities of Erlang.mk, for instance to create
hello_handler.erl, you could follow the cowboy Getting Started guide and create the hello_erlang release, then any time you need a template switch into that directory, generate the template, copy it, modify the module name, etc., then move it into your rebar3 app.The command
rebar3 shellcompiles and executes the same code in about 1 second compared to 30-40 seconds for Erlang.mk. Of course,rebar3 shellis not creating a release, but if you want to experiment with cowboy, then a rebar3 app seems like the best way to quickly compile and execute your code.