simplehttp 0.0.3 copy "simplehttp: ^0.0.3" to clipboard
simplehttp: ^0.0.3 copied to clipboard

A dart library used for making a simple HTTP server. This should be used for testing purposes and not for real production. As you can see in the example it's still bare bones.

A dart library used for making a simple HTTP server.

This should be used for testing purposes and not for real production.

As you can see in the example it's still bare bones.

Example #

import 'package:simplehttp/simplehttp.dart';

void main() {
  final application = SimpleHttp(port: 8080);
  application.get('/', (request, response) {
    response.status(200).json({
      'Test': 1,
    });
  });

  application.get('/:id', (request, response) {
    print(request.segments()[0]);
    response.status(200);
  });

  application.post('/post', (request, response) async {
    print(await request.body());
  });

  application.start();
}

1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A dart library used for making a simple HTTP server. This should be used for testing purposes and not for real production. As you can see in the example it's still bare bones.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

More

Packages that depend on simplehttp