yesodweb/yesod — Issue #259: port command line option does not override appRoot
Author: gregwebs
Created: 2012-02-09 01:27:10+00:00
State: open

Reproduce: scaffold a new site. Note that approot in the foundation reads appRoot from the settings, and by default there is a host and a port in the config/settings.yml file of 3000

Compile your app and run with -p 4000
The generated urls will still use port 3000

The quick workaround is to use a relative approot.

To solve this I think we need to add appHost and appProtocol/appSSL to AppConfig. One approach would be to disallow direct updates to AppConfig, but instead go through an API that would make sure to update appRoot. I think it is better to remove appRoot and have it generated and cached when a request wants a non-relative URL.