mod_http 1.1.1 icon indicating copy to clipboard operation
mod_http: ^1.1.1 copied to clipboard

A starting point for Dart libraries or applications.

example/mod_http_example.dart

import 'dart:io' as io;

import 'package:mod_http/mod_http.dart';

void main() async {
  var server = await HttpServer.bind(io.InternetAddress.LOOPBACK_IP_V4, 9090);
  print("Serving at ${server.address}:${server.port}");

  await for (var request in server) {
    request.response
      ..headers.contentType = new ContentType("text", "plain", charset: "utf-8")
      ..write('Hello, world')
      ..close();
  }
}
0
likes
95
pub points
0%
popularity

Publisher

unverified uploader

A starting point for Dart libraries or applications.

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

Dependencies

getstream, meta

More

Packages that depend on mod_http