elm-pages-v3-beta/examples/hackernews/app/Api.elm

28 lines
745 B
Elm
Raw Normal View History

2022-04-11 02:37:00 +03:00
module Api exposing (routes)
import ApiRoute exposing (ApiRoute)
2023-01-02 01:44:11 +03:00
import BackendTask exposing (BackendTask)
2022-04-11 02:37:00 +03:00
import Html exposing (Html)
import Pages.Manifest as Manifest
import Route exposing (Route)
import Site
routes :
2023-01-02 01:44:11 +03:00
BackendTask (List Route)
-> (Maybe { indent : Int, newLines : Bool } -> Html Never -> String)
2022-04-11 02:37:00 +03:00
-> List (ApiRoute.ApiRoute ApiRoute.Response)
routes getStaticRoutes htmlToString =
2023-01-02 01:44:11 +03:00
[ BackendTask.succeed manifest |> Manifest.generator Site.canonicalUrl
2022-04-11 02:37:00 +03:00
]
manifest : Manifest.Config
manifest =
Manifest.init
{ name = "Hacker News Clone"
, description = "elm-pages port of Hacker News"
, startUrl = Route.Feed__ { feed = Nothing } |> Route.toPath
, icons = []
}