我想在我的凤凰项目中使用ckeditor.
如果我将ckeditor文件放在/ web/static/assets/ckeditor中,ckeditor文件夹会被复制到/ priv/static,但如果我访问http:// localhost:4000/ckeditor/ckeditor.js的文件,它会显示给我
找不到GET /ckeditor/ckeditor.js的路由
但是,如果我将整个ckeditor文件夹移动到标准名称(js,css,image)的文件夹下,那么它就会被提供.
静态资产文档http://www.phoenixframework.org/docs/static-assets建议放置在那里的任何内容都会被复制并提供服务.但似乎只有js/css/image/font文件夹被提供,而不是任何自定义命名文件夹.
我怎样才能提供这些文件?
小智 17
看一下Plug.Static配置 lib/YOUR_APP/endpoint.ex
这是默认值:
plug Plug.Static,
at: "/"
only: ~w(css fonts images js sitemaps favicon.ico robots.txt)
Run Code Online (Sandbox Code Playgroud)
您可以将其他文件夹添加到only列表中,它们也将被提供.