a small incremental UI library for the web
javascript web ui
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Serve page

garrison 51fe0766 1d0384a2

+24 -7
+1 -1
config/config.exs
··· 4 4 config :esbuild, 5 5 version: "0.27.2", 6 6 default: [ 7 - args: ~w(js/todo.tsx --watch --bundle --target=es2016 --outdir=../priv/static/assets), 7 + args: ~w(js/todo.tsx --watch --bundle --target=es2016 --outdir=../priv/static/assets/js), 8 8 cd: Path.expand("../assets", __DIR__), 9 9 ] 10 10 end
+14 -6
lib/noir/dev_server.ex
··· 1 1 defmodule Noir.DevServer do 2 - import Plug.Conn 2 + use Plug.Router 3 3 4 - def init(options) do 5 - options 6 - end 4 + plug Plug.Static, 5 + at: "/", 6 + from: {:noir, "priv/static"} 7 7 8 - def call(conn, _opts) do 8 + plug :match 9 + plug :dispatch 10 + 11 + get "/" do 9 12 conn 10 - |> send_resp(200, "Noir") 13 + |> put_resp_header("location", "/todo.html") 14 + |> send_resp(302, "You are being redirected") 15 + end 16 + 17 + match _ do 18 + send_resp(conn, 404, "Not found") 11 19 end 12 20 end
+9
priv/static/todo.html
··· 1 + <!doctype html> 2 + <html> 3 + <head> 4 + <script src="/assets/js/todo.js"></script> 5 + </head> 6 + <body> 7 + <div>Hello</div> 8 + </body> 9 + </html>