Web server with recipe index page
- Add Roux.Server: WAI application using wai+warp directly - Scans .cook files from recipe directory on startup - GET / → HTML index page listing all recipes - Other routes → 404 - Add Roux.RecipeIndex: directory scanning and recipe parsing - scanRecipes: lists .cook files, parses each, extracts titles - Falls back to filename when metadata title is absent - Add Roux.Html: blaze-html rendering with Pico CSS - indexPage: renders recipe list with links - urlEncode: percent-encodes filenames for URLs - Update Roux.hs: re-exports Server.app and Types - Add filepath to dependencies
This commit is contained in:
@@ -17,7 +17,10 @@ build-type: Simple
|
||||
library
|
||||
exposed-modules:
|
||||
Roux
|
||||
Roux.Html
|
||||
Roux.Parser
|
||||
Roux.RecipeIndex
|
||||
Roux.Server
|
||||
Roux.Types
|
||||
other-modules:
|
||||
Paths_roux_server
|
||||
@@ -36,6 +39,7 @@ library
|
||||
, bytestring
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
, parsec
|
||||
@@ -64,6 +68,7 @@ executable roux-server
|
||||
, bytestring
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
, parsec
|
||||
@@ -96,6 +101,7 @@ test-suite roux-server-test
|
||||
, bytestring
|
||||
, containers
|
||||
, directory
|
||||
, filepath
|
||||
, hspec
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
|
||||
Reference in New Issue
Block a user