fileheron_server 1.0.5 copy "fileheron_server: ^1.0.5" to clipboard
fileheron_server: ^1.0.5 copied to clipboard

A simple file server written in Dart to deploy a local file server on Windows, MacOS and Linux in seconds.

FileHeronServer #

A Simple file server

Features #

  • Allows running a local server on machine as a static or rest file server.

Getting started #

  • Import the package in pubspec.yaml file as fileheron_server to use it.

Usage #

void main(List<String> args) {
  var server = FileHeronServer();
  ServerParams params = ServerParams(
      hostname: "locahost",
      port: 80,
      listDir: true,
      logFile: "log.txt",
      root: "public");
  server.initStaticServer(params);
  server.start();
}

Runtime arguments Parameters #

You can also use runtime arguments directly to initialize server

Parameter Description Default Value Possible Values
host (-h) Hostname localhost valid address
port (-p) Port 80 valid port
root (-r) Static folder public valid folder
listDir (-d) Show each call in console true true, false
logFile (-l) Log file null log file name
ssl (-s) SSL Mode false true, false
certificateChain (-c) Certificate Chain null valid file name
serverKey (-k) Server Key null valid file name
serverKeyPassword (-u) Server Key Password null password

For example:

void main(List<String> args) {
  var server = FileHeronServer();
  ServerParams params = ServerParams(args);
  server.initStaticServer(params);
  server.start();
}

and the commandline arguments could be passed as follows:

fileheron --host localhost --port 80 --root public --listDir true --logFile log.txt --ssl true --certificateChain server_chain.pem --serverKey server_key.pem --serverKeyPassword password

or

fileheron -h localhost -p 80 -r public -d true -l log.txt -s true -c server_chain.pem -k server_key.pem -u password

To be done #

The SSL does not work at the moment. We are working on it, community is also welcome to support the project.

Additional information #

To contribute to this opensource project, open pull requests or issues in git repo

3
likes
140
pub points
15%
popularity

Publisher

verified publisherhorizech.com

A simple file server written in Dart to deploy a local file server on Windows, MacOS and Linux in seconds.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

args, http_server, shelf

More

Packages that depend on fileheron_server