Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Phoenixでディレクトリリスティングを取るには

 Phoenixでディレクトリリスティングを取るには

Presentation for tokyo.ex #7 / 歌舞伎座.tech #13 11-JAN-2017

Fc3b290038a97f5df6fec7660c357ef4?s=128

Kenji Rikitake

January 11, 2017
Tweet

Transcript

  1. PhoenixͰσΟϨΫτϦϦεςΟϯά ΛऔΔʹ͸ ྗ෢ ݈࣍ ྗ෢݈ٕ࣍ज़࢜ࣄ຿ॴ / ϖύϘݚڀॴ 2017೥1݄11೔ @jj1bdx tokyo.ex

    #7 / Վ෣ب࠲.tech #13 Kenji Rikitake / tokyo.ex #7 11-JAN-2017 1
  2. ࣗݾ঺հ Erlang/OTPྺ9೥ऑ Elixirྺ2೥ऑͷॳ৺ऀ ϖύϘݚڀॴݟश͍ Webؔ࿈શ෦΍ͬͯ·͢ Kenji Rikitake / tokyo.ex #7

    11-JAN-2017 2
  3. σΟϨΫτϦϦεςΟϯά ӈ͸Yawsͷྫ ͜Μͳײ͡Ͱ੩తίϯςϯπ ͷϦετΛऔΓ͍ͨ Apache, Nginx, Yaws ͳΒ؆୯ʹऔΕ Δɺ͕… Kenji

    Rikitake / tokyo.ex #7 11-JAN-2017 3
  4. Phoenix/PlugͰ͸͚ͬ͜͏೉͍͠ Phoenixͷ੩తίϯςϯπͰ͸Plug.StaticΛ࢖͏ • ύεΛσΟϨΫτϦʹϚοϓʢΞΫηε੍ݶՄʣ • ϑΝΠϧͳΒ಺༰Λmime typeͱ͍ͬ͠ΐʹฦ͢ • ϑΝΠϧͰͳ͍৔߹͸ແࢹͯ࣍͠ͷPlug΁ˠ͜͜ʹσΟϨΫ τϦͩͬͨ৔߹ͷॲཧΛPlugͱͯ͠ॻ͍ͯ΍ΔͱΑͦ͞͏

    Kenji Rikitake / tokyo.ex #7 11-JAN-2017 4
  5. ϞδϡʔϧΛ୳ͨ͠ …ͳ͔ͬͨ Kenji Rikitake / tokyo.ex #7 11-JAN-2017 5

  6. ͳ͚Ε͹࡞Δ Kenji Rikitake / tokyo.ex #7 11-JAN-2017 6

  7. θϩ͔Βॻ͘ͱ݁ߏେม σΟϨΫτϦͩͬͨΒҎԼͷॲཧΛ͢Δ • ϦετΛऔΔʢιʔτΞϧΰϦζϜ͸ม͑ΒΕΔʣ • ιʔτΞϧΰϦζϜ͸GETͷqueryύϥϝʔλͰࢦఆ • ϑΝΠϧͷଐੑΛऔಘͯ͠දࣔ • Ұ౓ઃఆͨ͠ΞϧΰϦζϜ͸URLͷதʹೖΕͯอ࣋

    Kenji Rikitake / tokyo.ex #7 11-JAN-2017 7
  8. ੒Ռ: plug_static_ls Ϟδϡʔϧ໊͸PlugStaticLsɺendpointʹ͜Μͳײ͡Ͱઃఆ plug Plug.Static, at: "/static", from: "/files", gzip:

    false, only: ~w(images public js css) plug PlugStaticLs, at: "/static", from: "/files" only: ~w(images public) # ֘౰͠ͳ͍΋ͷ͸௨ա/ॲཧͷࢦఆ͕ඞཁ Kenji Rikitake / tokyo.ex #7 11-JAN-2017 8
  9. plug_static_lsͷը໘ ͚ͬ͜͏ॲཧ͕͔͔࣌ؒΔʢ਺msʙ਺ ඦmsʣͷͰެ։༻్ʹ͸޲͔ͳ͍ ϑΥϧμͷը૾͸Base64ͷimgόΠφϦ ͰೖΕΒΕͳ͘͸ͳ͍͕ϖʔδαΠζ͕ େ͖͘ͳΔͷͰ΍Ίͨ ͦΕͰ΋ҰԠYawsͬΆ͘͸ͳ͍ͬͯΔ Kenji Rikitake /

    tokyo.ex #7 11-JAN-2017 9
  10. plug_static_ls https://hex.pm/packages/plug_static_ls https://github.com/jj1bdx/plug_static_ls Kenji Rikitake / tokyo.ex #7 11-JAN-2017 10

  11. Thank you Kenji Rikitake / tokyo.ex #7 11-JAN-2017 11