Created
June 4, 2020 09:22
-
-
Save leomayleomay/8792539be117965550d50bac5d209882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// here's the code binds to the port | |
mkServer :: Env -> HTTPure.ServerM | |
mkServer env = do | |
mPort <- lookupEnv "PORT" | |
let | |
port = fromMaybe 8080 $ fromString =<< mPort | |
HTTPure.serve port (middleware env router) do | |
Console.log $ "Server running on " <> show port | |
// here's package.json: | |
{ | |
"engines": { | |
"node": "12.x" | |
}, | |
"scripts": { | |
"watch": "spago build --watch", | |
"bundle": "spago bundle-app -t dist/index.js && ncc build -m dist/index.js -o dist/bundle" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment