Last updated:
0 purchases
petit httpd
petit_httpd #
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: '0.0.0.0',
letsEncryptDirectory: Directory('/etc/letsencrypt/live'),
domains: {'mydomain.com': '[email protected]'});
var ok = await petitHTTPD.start();
if (!ok) {
print('** ERROR Starting: $petitHTTPD');
exit(1);
}
print('-- STARTED: $petitHTTPD');
}
copied to clipboard
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
copied to clipboard
To run an HTTP Daemon:
$> petit_httpd ./www --port 8080 --securePort 443 --address 0.0.0.0 --letsencrypt-path /etc/letsencrypt/live --domain mydomain.com
copied to clipboard
A BASH script with all together:
#!/bin/bash
dart pub global activate petit_httpd
export PATH="$PATH":"$HOME/.pub-cache/bin"
mkdir -p /var/log/petit_httpd
petit_httpd /var/www --address 0.0.0.0 --letsencrypt-path /etc/letsencrypt/live --domain mydomain.com -verbose >> /var/log/petit_httpd/requests.log
copied to clipboard
Source #
The official source code is hosted @ GitHub:
https://github.com/gmpassos/petit_httpd
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.