lfe-http / barista

Barista serves up hot lmugs of LFE for your simple HTTP needs.
Apache License 2.0
6 stars 1 forks source link

Config parsing issues and lmug adapter #2

Closed burma-shave closed 3 years ago

burma-shave commented 8 years ago

I've been playing around a little with barista and noticed some issues and have some ideas for enhancements. I'd be happy to work on some PRs but wanted to check what your thoughts were before I start.

In barista-options.lfe this func is not happy when lcfg:get-in/1 returns 'undefined:

(defun basedir ()
  (let ((basedir (lcfg:get-in '(barista httpd-conf server-root))))
    (case (car basedir)
      (#\/ basedir)
      (_ (filename:join (get-cwd) basedir)))))

(car basedir) throws an error:

exception error: badarg
  in (: erlang hd undefined)
  in barista-options:basedir/0 (/Users/ericj/software_development/projects/barista/src/barista-options.lfe, line 17)

This was happening when attempting to use barista from a checkout of lmug and there is no life.config defined. This also happens in docroot/0. Not sure what the intended behaviour is here. The lfe.config indicates these settings are mandatory, but I thought they would default to some value if there was no lfe.config.

Also, the the lmug adapter is still calling barista:run instead of barista:start.

I've been looking for some LFE stuff to do and I thought this might be a good place to start. I'm proposing to do the following:

oubiwann commented 3 years ago

Wow, haven't poked into this project in hears -- deep apologies for no response.

I'm actually going to close this ticket due to #3 ... the refactoring (and deep simplification) will make this no longer applicable :-(

Again, apologies.