Precompiled Single-Page-Apps in Phoenix App

后端 未结 2 746
误落风尘
误落风尘 2021-02-04 13:22

I have a pre-compiled ember.js app (which fronted-js-framework shouldn\'t matter here), which basically consists of a folder with a index.html file, and a few js/css assets.

2条回答
  •  旧巷少年郎
    2021-02-04 13:47

    I think easiest way to replace web/templates/layout/app.html.eex with your index html and change assets path inside with <%= static_path(@conn, "/js/app.js") %> helpers to grab your ember app js file from static folder.

    Router part:

    scope "/", Chat do
      pipe_through :browser
      get "/", PageController, :index
    end
    

    And inside action render conn.

提交回复
热议问题