[erlang-questions] request: sense-check proposed approach

sfinnie scott.finnie@REDACTED
Mon Feb 18 20:23:41 CET 2019


Folks,

I'm about to start a new app.  I'd be grateful if someone would run an 
eye over proposed approach below and highlight anything you think is 
suspect/better approach available/whatever.

* Web application:

     * Erlang-based REST services on the back end

     * Front end mostly static html/css with a little Elm* for interaction.

* Cowboy as the means to deliver REST services

* In the spirit of keeping things simple, I'm thinking of using Cowboy 
to serve all static files (inc html, css and compiled js from the Elm 
app).  However, Cowboy docs say this is "development only".  Is Cowboy 
static routing a no-go in production, or is this more symptomatic of 
scalability?  The app won't have high load (3-4 users).

* Cowboy uses erlang.mk instead of rebar3.  Is there a way to convert to 
rebar3?  Is it worth the hassle?  Couldn't find anything recent in 
searching the web.

* I'd like to use sync:go() (https://github.com/rustyio/sync) or similar 
for automatically rebuilding.  I've tried incorporating into a simple 
cowboy app.  It loads and recompiles changes OK, but doesn't seem to 
reload into the currently-running system.  Rel setup below.

Any comments/suggestions appreciated.

Thanks,

Scott.

--

* I'm intrigued by the Elm language/architecture so want to explore in a 
small but meaningful example.

Relevant setup as follows.

relx-dev.config:

{dev_mode, true}.
{lib_dirs, ["/home/scoot/ERL_LIBS"]}.
{release,
  {fmt_dev, "0.0.1"},
  [fmt, jsx, sasl, syntax_tools, compiler, sync, runtime_tools]
}.
{extended_start_script, true}.
{sys_config, "config/sys.config"}.
{vm_args, "config/vm.args"}.

Release built using ".erlang.mk/relx -c relx-dev.config" and run with 
"_rel/fmt_dev/bin/fmt_dev console"






More information about the erlang-questions mailing list