Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leomayleomay/8792539be117965550d50bac5d209882 to your computer and use it in GitHub Desktop.
Save leomayleomay/8792539be117965550d50bac5d209882 to your computer and use it in GitHub Desktop.
// 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