basic_web_server 1.0.0 copy "basic_web_server: ^1.0.0" to clipboard
basic_web_server: ^1.0.0 copied to clipboard

This is a simple HTTP web server, that will listen with routes.

Example usage #

final server = basic_web_server.Server(port: 2000)
    ..get('/', (HttpRequest request) {
    request.response
        ..statusCode = HttpStatus.ok
        ..headers.contentType = ContentType.html
        ..write([
            '<style>body {background-color: navy; color: white; font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0;}</style>',
            '<div><h1>Welcome to using webserver!</h1><p>This is the example page.</p></div>',
        ].join('\n'))
        ..close();
    })

    ..start();
0
likes
150
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

This is a simple HTTP web server, that will listen with routes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

mysql1, path, rich_stdout

More

Packages that depend on basic_web_server