5import Bun.Server as Bun
6import Data.Maybe (Maybe)
9import Effect.Console (log)
10import PureStack.Route (type (/), GET, Headers(..), Middleware, POST)
11import PureStack.Route as Router
12import PureStack.Server as Server
13import Run (AFF, Run(..), runBaseAff)
14import Type.Row (type (+))
16type Foo = { a :: String, b :: Maybe Int, c :: Array Number }
19 ( foo :: "foo" / "bar" / Foo / GET Unit { a :: Int, b :: Number, c :: Foo }
20 , bar :: "foo" / Middleware "auth" / "qux" / POST (Headers { foo :: String } Unit) { a :: Int, s :: String }
23 ( something :: "something" / GET Unit { a :: String }
30 Bun.serve $ Server.run @API identity
32 { foo: \x -> pure { a: 1, b: 1.0, c: x }
33 , bar: \i (Headers x _) -> pure { a: 8, s: x.foo }
34 , deep: { something: pure { a: "something" } }
36 , middlewares: { auth: \req -> pure 1 }
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list