petit_httpd 1.1.0 copy "petit_httpd: ^1.1.0" to clipboard
petit_httpd: ^1.1.0 copied to clipboard

A simple HTTP file server integrated with Let's Encrypt, gzip and CORS.

example/petit_httpd_example.dart

import 'dart:io';

import 'package:petit_httpd/petit_httpd.dart';

void main() async {
  var petitHTTPD = PetitHTTPD(Directory('/var/www'),
      port: 8080,
      securePort: 443,
      bindingAddress: '0.0.0.0',
      letsEncryptDirectory: Directory('/etc/letsencrypt/live'),
      domains: {'mydomain.com': 'contact@mydomain.com'});

  var ok = await petitHTTPD.start();

  if (!ok) {
    print('** ERROR Starting: $petitHTTPD');
    exit(1);
  }

  print('-- STARTED: $petitHTTPD');
}
2
likes
140
pub points
0%
popularity

Publisher

unverified uploader

A simple HTTP file server integrated with Let's Encrypt, gzip and CORS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

args_simple, shelf, shelf_gzip, shelf_letsencrypt, shelf_static

More

Packages that depend on petit_httpd