ptwebserver 0.2.4

  • README.md
  • Installing
  • Versions
  • 26

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();
}

Use this package as a library

1. Depend on it

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


dependencies:
  ptwebserver: "^0.2.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:ptwebserver/ptwebserver.dart';
  
Version Uploaded Documentation Archive
0.2.4 Feb 17, 2014 Go to the documentation of ptwebserver 0.2.4 Download ptwebserver 0.2.4 archive
0.2.3 Feb 14, 2014 Go to the documentation of ptwebserver 0.2.3 Download ptwebserver 0.2.3 archive
0.2.2 Feb 4, 2014 Go to the documentation of ptwebserver 0.2.2 Download ptwebserver 0.2.2 archive
0.2.1 Feb 4, 2014 Go to the documentation of ptwebserver 0.2.1 Download ptwebserver 0.2.1 archive
0.2.0 Feb 3, 2014 Go to the documentation of ptwebserver 0.2.0 Download ptwebserver 0.2.0 archive
0.1.1 Feb 1, 2014 Go to the documentation of ptwebserver 0.1.1 Download ptwebserver 0.1.1 archive
0.1.0 Feb 1, 2014 Go to the documentation of ptwebserver 0.1.0 Download ptwebserver 0.1.0 archive
0.0.15 Feb 1, 2014 Go to the documentation of ptwebserver 0.0.15 Download ptwebserver 0.0.15 archive
0.0.14 Feb 1, 2014 Go to the documentation of ptwebserver 0.0.14 Download ptwebserver 0.0.14 archive
0.0.13 Feb 1, 2014 Go to the documentation of ptwebserver 0.0.13 Download ptwebserver 0.0.13 archive

All 22 versions...

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
86 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
26
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:ptwebserver/ptwebserver.dart with components: io.

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Homepage does not exists.

    We were unable to access https://github.com/ptdave20/ptwebserver at the time of the analysis.

  • Package is too old.

    The package was released more than two years ago.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 17 hints.

    Strong-mode analysis of lib/ptwebserver.dart failed with the following error:

    line: 42 col: 19
    The argument type '(String, List<ptHost>) → Null' can't be assigned to the parameter type '(dynamic, dynamic) → void'.

    Run dartfmt to format lib/config.dart.

    Similar analysis of the following files failed:

    • lib/ext/def.dart (hint)
    • lib/ext/php.dart (hint)
    • lib/extHandler.dart (hint)
  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use ptwebserver.dart.