sugar-framework / sugar

Modular web framework for Elixir
https://sugar-framework.github.io/
MIT License
430 stars 29 forks source link

Static files location #96

Closed kination closed 7 years ago

kination commented 7 years ago

I'm currently working for make some web sample which is working with sugar + vue.js. While looking on, it cannot indicate the location of vue lib and my js file. I located my file inside of /priv/static/js(for js files) and /priv/static/tpl(for templates). Is there something wrong in my work?

And this is just suggestion... Currently our generated files by sugar init are showing just response in page. How about change this with some html page? I think it will be a more good guide for using this.

conn > resp(200, "")  => conn |> static("tpl/index.html")

How do you think?

YellowApple commented 7 years ago

I take it you've already perused the relevant documentation (under the "Static files" section)?

In particular, static files are by default going to be accessible from http://localhost:4000/static/. This can be overridden in your router if you prefer a different path:

defmodule MyApp.Router do
  # ...
  plug Plug.Static, at: "/some/other/path", from: :my_app
  # ...
end
kination commented 7 years ago

@YellowApple Okay, there could be some mistake. I'll try it again.