Overriding approot when running yesod devel

53 views
Skip to first unread message

Marko Kocić

unread,
Apr 4, 2013, 5:49:48 PM4/4/13
to hle...@googlegroups.com
Hi all,

I know that you can use --base-url when running hledger-web to set host name.
Is there a way to specify externally approot to be used when using "yesod --dev devel" or "yesod devel" option? I saw somewhere mentioned that APPROOT environment variable can be used to specify approot, but this didn't work.

I played with a few yesod tutorials, and I like the fact that "yesod devel" automatically recompiles the application in the background while editing without restarting the server. It would be great if it supported custom approot option, since I do all my hacking on a vps server.

I know I can change config/settings.yml and specify approot there, but I'd rather not do that, since that file is versioned and I wouldn't like to accidentaly commit it with my vps server address in it.

Cheers,
Marko

Simon Michael

unread,
Apr 4, 2013, 8:48:06 PM4/4/13
to hle...@googlegroups.com
 
 
 
On Thu, Apr 4, 2013, at 02:49 PM, Marko Kocić wrote:
I know that you can use --base-url when running hledger-web to set host name.
Is there a way to specify externally approot to be used when using "yesod --dev devel" or "yesod devel" option? I saw somewhere mentioned that APPROOT environment variable can be used to specify approot, but this didn't work.
 
Hi Marko,
 
yesod devel can't set the base url on the command line currently - it look like you'll have to do it in settings.yml. Here are some things to be aware of: 
 
- yesod devel's console output at startup always shows hostname "localhost", regardless of the approot actually in effect.
 
- the port: option in settings.yml does not affect which port the app listens on; you must use --port if you want to change that.
 
I played with a few yesod tutorials, and I like the fact that "yesod devel" automatically recompiles the application in the background while editing without restarting the server. It would be great if it supported custom approot option, since I do all my hacking on a vps server.
 
An alternative to yesod devel is "make autoweb". It is suffering from a little bitrot though. To make it work you need to 1. remove $(PROFBUILDFLAGS)  from the AUTOBUILDFLAGS in Makefile 2. resolve build errors in Query.hs and elsewhere due to having TypeFamilies and GADTs enabled (which autoweb does for all files, though only yesod needs them).
 
I know I can change config/settings.yml and specify approot there, but I'd rather not do that, since that file is versioned and I wouldn't like to accidentaly commit it with my vps server address in it.
 
What if you add it to the ignore/boring file ?
 
Reply all
Reply to author
Forward
0 new messages