Allows configuring the root directory for the directory middleware when using batteries

Related to issue #68