I know that can add set of docroot in yaws.conf but this not always convenient. Is exist way to start of server from current directory with yaws without modifying configuration file?
Asked
Active
Viewed 65 times
1 Answers
0
Two options:
Keep a template of your
yaws.conf
file somewhere and invokeyaws
through a script that first uses the template to create a conf file with the current working directory filled in asdocroot
, and then runsyaws
using its--conf
command-line option to specify the newly-created conf file as its configuration file.Run
yaws
in embedded mode, which allows you to programmatically specify the configuration. You can usefile:get_cwd/0
to obtain the pathname of the current working directory, then use it as the value fordocroot
in the configuration details you pass toyaws_api:embedded_start_conf/1,2,3,4
.

Steve Vinoski
- 19,847
- 3
- 31
- 46