fileheron_server 1.0.5

SDKdartflutter
Platformandroidioswindowslinuxmacos

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

ParameterDescriptionDefault ValuePossible Values
host (-h)Hostnamelocalhostvalid address
port (-p)Port80valid port
root (-r)Static folderpublicvalid folder
listDir (-d)Show each call in consoletruetrue, false
logFile (-l)Log filenulllog file name
ssl (-s)SSL Modefalsetrue, false
certificateChain (-c)Certificate Chainnullvalid file name
serverKey (-k)Server Keynullvalid file name
serverKeyPassword (-u)Server Key Passwordnullpassword

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