Search code examples
streamdartrikulo

Rikulo stream base folder


Is it possible to choose to serve files only from a specific folder using Rikulo stream? I've tried

new StreamServer(uriMapping: _mapping, homeDir: 'my/web/webapp/app')

but I'm not getting the desired results as it's still serving files under the 'web' directory.


Solution

  • When homeDir is specified with a relative path, it is assumed to be relative to the current directory (Directory.current.path). I think it is not what you expect. You can use an absolute path for better control.

    After examining the code, I think the relative path is better to base on the root directory rather than the current directory. Please follow Issue 29 for details. Also refer to the sample app here.