1
0

Compare commits

...

3 Commits

Author SHA1 Message Date
9b7a19f4d2 Update Main.hs file with Scotty example code. 2025-05-07 22:47:16 +02:00
b26291d014 Add Scotty to project. 2025-05-07 22:44:18 +02:00
4a9a405310 Update README. 2025-05-07 22:44:02 +02:00
3 changed files with 15 additions and 3 deletions

View File

@ -7,8 +7,13 @@ This project is my attempt to learn the Haskell programming language and build a
* `cabal init`
* `cabal run`
* `cabal build`
* `cabal freeze`
* `cabal install --only-dependancies`
### Packages
* [Scotty](https://hackage.haskell.org/package/scotty)
## Links
* [adit.io - Making A Website With Haskell](https://www.adit.io/posts/2013-04-15-making-a-website-with-haskell.html)

View File

@ -1,4 +1,9 @@
module Main where
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
main :: IO ()
main = putStrLn "Hello, Haskell!"
main = scotty 3000 $
get "/:word" $ do
beam <- pathParam "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]

View File

@ -68,7 +68,9 @@ executable portfolio-haskell
-- other-extensions:
-- Other library packages from which modules are imported.
build-depends: base ^>=4.17.2.1
build-depends: base ^>=4.17.2.1 && <5
, scotty >= 0.22 && < 0.23
, text
-- Directories containing source files.
hs-source-dirs: app