micro_serve 1.0.3 copy "micro_serve: ^1.0.3" to clipboard
micro_serve: ^1.0.3 copied to clipboard

A Flutter package initializes an HTTP server to handle HTTP requests.

Micro Serve #

pub package

The micro_serve package for Flutter is designed to initialize an HTTP server that efficiently manages requests and server-side operations within applications.

Features #

  • HTTP Handling: Manage incoming HTTP requests and send responses.

  • Routing: Define routes (GET, POST, PUT, DELETE, PATCH) and link them to request handlers.

  • Request Parsing: Read and parse query parameters and body data from requests.

  • Response Handling: Create and send responses with status codes, headers, and content.

  • Error Handling: Gracefully manage errors and send appropriate error responses.

Getting started #

Add the package to your pubspec.yaml file:

dependencies:
  micro_serve: <latest version>

Usage #

Import the Package:

import 'package:micro_serve/micro_serve.dart';

Initialize the Server:

void main() {
  final MicroServe server = MicroServe();

  server.get("/hello", (ServerContext serverContext) async {
    Response response = Response(
      statusCode: 200,
      data: "Welcome Micro-Serve",
    );
    serverContext.send(response);
  });

  server.listen(ipAddress: "127.0.0.1", port: 2000);
}

Additional information #

This Micro Server plugin is developed by Mahadi Hassan.

LinkedIn | GitHub | Website

7
likes
0
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package initializes an HTTP server to handle HTTP requests.

Homepage
Repository

License

unknown (license)

More

Packages that depend on micro_serve