petit_httpd 1.0.4 icon indicating copy to clipboard operation
petit_httpd: ^1.0.4 copied to clipboard

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

petit_httpd #

pub package Null Safety Codecov CI GitHub Tag New Commits Last Commits Pull Requests Code size License

This is a simple HTTP file server integrated with Let's Encrypt, gzip and CORS.

Motivation #

Since Dart can run in many native platforms (Linux/x64, macOS/x64/arm64, Windows/x86), it can be an awesome way to have an HTTP Server running in any place, including all the basic features needed today.

API Documentation #

See the API Documentation for a full list of functions, classes and extension.

Usage #

import 'dart:io';

import 'package:petit_httpd/petit_httpd.dart';

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

  var ok = await petitHTTPD.start();

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

  print('-- STARTED: $petitHTTPD');

CLI Tool #

petit_httpd #

The petit_httpd is a CLI for the PetitHTTPD class.

First activate the petit_httpd command:

$> dart pub global activate petit_httpd

To run an HTTP Daemon:

$> petit_httpd ./www --port 8080 --securePort 443 --address --letsencrypt-path /etc/letsencrypt/live --domain

A BASH script with all together:


dart pub global activate petit_httpd

export PATH="$PATH":"$HOME/.pub-cache/bin"

mkdir -p /var/log/petit_httpd

petit_httpd /var/www --address --letsencrypt-path /etc/letsencrypt/live --domain -verbose  >> /var/log/petit_httpd/requests.log

Source #

The official source code is hosted @ GitHub:

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Contribution #

Any help from the open-source community is always welcome and needed:

  • Found an issue?
    • Please fill a bug report with details.
  • Wish a feature?
    • Open a feature request with use cases.
  • Are you using and liking the project?
    • Promote the project: create an article, do a post or make a donation.
  • Are you a developer?
    • Fix a bug and send a pull request.
    • Implement a new feature, like other training algorithms and activation functions.
    • Improve the Unit Tests.
  • Have you already helped in any way?
    • Many thanks from me, the contributors and everybody that uses this project!

If you donate 1 hour of your time, you can contribute a lot, because others will do the same, just be part and start with your 1 hour.

Author #

Graciliano M. Passos: gmpassos@GitHub.

License #

Apache License - Version 2.0

pub points


unverified uploader

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

Repository (GitHub)
View/report issues


API reference


Apache-2.0 (LICENSE)


args_simple, shelf, shelf_gzip, shelf_letsencrypt, shelf_static


Packages that depend on petit_httpd