ptwebserver 0.2.4

ptWebServer is a configuration web server that supports multiple hosts and addresses. It can be as simple as a simple web server with no extras to a very custom server response.

Warning: You must close the response when using a custom request callback

PHP execution

In your config, you may enable PHP and give it the path to PHP and using a little magic, send PHP responses. It should also pass along variables as well to both $_POST , $_GET and $_REQUEST appropriately. However, data beyond that point is currently not supported.

This feature has been tested mildly and in Linux.

Example usage:

import 'package:ptwebserver/ptwebserver.dart';

void main() {
  ptConfig cfg = new ptConfig();
  cfg.servername = "DCS_Intranet";
  
  ptHost host = new ptHost();
  host.name = "test";
  host.address = "127.0.0.1";
  host.port = 8080;
  host.hostnames.add("test");
    
  host.public_path = "/var/www/";
  host.SetDefaultHandlers();
  host.public_index_files.add("index.html");
  host.public_index_files.add("index.php");
  host.public_index_files.add("index.htm");
  
  host.allow_dir_view = true;
  
  cfg.hosts.add(host);
  
  
  ptWebServer server = new ptWebServer(cfg);

  server.Run();
}

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  ptwebserver: 

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support pub. Check the docs for your editor to learn more.

About

Configurable web server. Currently has PHP support. More language support to come.

Author

Email ptdave20@gmail.com David Marchbanks

Homepage

github.com/ptdave20/ptwebserver

Documentation

www.dartdocs.org/documentation/ptwebserver/0.2.4/

Source code (hyperlinked)

www.crossdart.info/p/ptwebserver/0.2.4/

Uploader

ptdave20@gmail.com

Share