kittoframework / kitto

Kitto is a framework for interactive dashboards written in Elixir
http://kitto.io/dashboards/sample
MIT License
955 stars 58 forks source link

Kitto.root not considered for serving assets #52

Closed chrta closed 7 years ago

chrta commented 7 years ago

I would like to use kitto (current master branch because of Kitto.root) in an umbrella project.

In my top level config.exs i already set:

config :kitto, root: Path.dirname(__DIR__) <> "/apps/kitto_dashboard", port: 4002

But when starting the umbrella project with

MIX_ENV=prod mix run --no-halt

I do not see the dashboard, since no assets are loaded. The dashboard itself is found.

Possible root cause

I think the problem is that Kitto.root is not considered here: https://github.com/kittoframework/kitto/blob/master/lib/kitto/router.ex#L12

Workaround

As a workaround creating a symbolic link on the top level umbrella project fixes the issue:

ln -s apps/kitto_dashboard/public public
zorbash commented 7 years ago

Thanks for reporting this issue. Kitto hasn't been tested in umbrella projects and it seems like you hit a bug. Are you willing to submit a PR for this? Seems like an easy fix.

chrta commented 7 years ago

Ok, i will try to fix it

zorbash commented 7 years ago

Resolved by #53.

@chrta Can you share more details about your experience using Kitto in an umbrella project? Did it take anything else to make it work?