simple_server 0.2.1 simple_server: ^0.2.1 copied to clipboard
Wrappes the dart.io HTTPServer and provides an simple API to manage incomming calls. uses the route_provider package
SimpleServer #
Installation #
Add it to your dependencies
dependencies:
simple_server: any
and install the package
$ pub get
Usage #
import 'dart:io';
import 'package:simple_server/simple_server.dart';
main() async {
server = new SimpleServer("/", "/docroot");
bool serverStarted = await server.start();
if (serverStarted == true) {
/* Web pages */
server.route(url: "/", responser: new FileResponse("docroot/index.html"))
..go();
}
}
Contributing #
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Credits #
Robert Beyer 4sternrb@googlemail.com
License #
MIT