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

Overview

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: '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');
}

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 0.0.0.0 --letsencrypt-path /etc/letsencrypt/live --domain mydomain.com

A BASH script with all together:

> /var/log/petit_httpd/requests.log">
#!/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

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

You might also like...

Flutter Presence App integrated with geolocation (GPS) that can help your company or you as a developer to build a presence app

Flutter Presence App integrated with geolocation (GPS) that can help your company or you as a developer to build a presence app

Flutter Presence App integrated with geolocation (GPS) that can help your company or you as a developer to build a presence app. beauty user interface and have a multi user ( admin and employee ). You can also change the appearance of this application easily or add new features. Using Getx and Firebase.

Dec 25, 2022

This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return as Image and share them directly as well in the form of an image.

share_files_and_screenshot_widgets This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return a

Dec 28, 2022

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully

Jan 1, 2023

A shopping cart application that lets the user create an account, select items, save the items in the cart, pay using the payment gateway, change account details and check order history.

Shopping Cart A new Flutter application. The main code file has all the code required for the mobile application. Getting Started This project is a st

Oct 14, 2021

Android app that converts an URL to markdown, and lets you share it to your favorite notes app.

Android app that converts an URL to markdown, and lets you share it to your favorite notes app.

markdownr Android app that converts an URL to markdown, and lets you share it to your favorite notes app. I've written this app to save articles I fou

Dec 10, 2022

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

Oct 21, 2022

Radiao - a radio explorer app that lets you listen to several stations of various countries

Radiao - a radio explorer app that lets you listen to several stations of various countries

radiao Radiao is a radio explorer app that lets you listen to several stations of various countries. features trending stations popular stations liste

Apr 20, 2022

Chopper is an http client generator using source_gen and inspired from Retrofit.

Chopper is an http client generator using source_gen and inspired from Retrofit.

Chopper Chopper is an http client generator for Dart and Flutter using source_gen and inspired by Retrofit. Documentation Installation Please refer to

Dec 31, 2022

cosmic_frontmatter is a package that provides a simple way to parse the frontmatter of a markdown file.

cosmic_frontmatter cosmic_frontmatter is a package that provides a simple way to parse the frontmatter of a markdown file. Getting started To get star

Oct 26, 2022
Releases(1.0.4)
Owner
Graciliano Monteiro Passos
Graciliano Monteiro Passos
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Stable Kernel 2.4k Jan 5, 2023
server side dart micro-framework to handle incoming http requests

Queen Palace ???? Introduction server side dart micro-framework to handle incoming http requests

Ahmed Masoud 32 Aug 30, 2022
Munem Sarker 1 Jan 25, 2022
A API integrated 5 day weather forecast and prediction application created using flutter framework and Dart language.

A API integrated 5 day weather forecast and prediction application created using flutter framework and Dart language. This API used here is OPEN WEATHER API, which specializes in predicting the weather of any city in this world.

Nitin Verma 0 Dec 26, 2021
Integrated Docker with Mobile App using python API and Can perform almost all functionality of Docker

tech_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Keshav Sharma 0 Oct 29, 2021
This plugin lets you show a message in a simple way.

error_message This plugin lets you show a message in a simple way. Usage ErrorMessage( icon: Icon(Icons.error), title: "Error Title",

TamilKannan-Developer 0 Dec 5, 2021
Mobile first Note Taking integrated with Git

Mobile first Markdown Notes integrated with Git This project receives generous infrastructure support from Summary GitJournal is a note taking app foc

GitJournal 2.8k Dec 31, 2022
Microsoft Teams Clone is a Video conference application with a rich integrated chat experience, to connect with friends,family & colleagues. Developed as a redesign of Microsoft Teams during my menteeship at Microsoft Engage 2021

Microsoft Teams Clone by Karanjot Singh About Microsoft Teams Clone is a Video conference application with a rich integrated chat experience, to conne

Karanjot Singh 60 Dec 28, 2022
Dio desafio chatonline flutter firebase - Developing an Online Chat Application Integrated with Firebase

Desenvolvendo um aplicativo de Chat Online integrado ao Firebase Descrição Neste

Yian Zaratin 1 Jan 4, 2022
A Flutter app integrated with Firebase🔥 to manage warehouse's 🏬 stock

Warehouse Management ?? An application to manage the inventory in multiple warehouses of a business. The products will be stored in groups and user ca

Hevesh Lakhwani 21 Nov 7, 2022