A lightweight HTTP server framework for Dart.

Related tags

Services arowana
Overview

arowana

A lightweight HTTP server framework for Dart.It is based on the shelf library for handling HTTP requests and implements a high-performance routing with reference to Golang's Gin framework.

Usage

A simple usage example:

import 'dart:isolate';
import 'package:arowana/arowana.dart';

class MyAChannel extends DefaultChannel{

  @override
  Future prepare() {
    print('current isolate [${Isolate.current.debugName}]');
    return super.prepare();
  }

  @override
  void entryPoint() {
    get('/hello', (r){
      return Response.ok('hello,arowana!');
    });
  }
}


void main() {
  var app = Application(MyAChannel());
  app.start(numberOfInstances: 2,consoleLogging: true);
}

Another example, containing grouped routes:

class MyAChannel extends AppChannel {
  Router app = Router();

  Middleware verification() => (innerHandler) {
        return (request) async {
          if (request.query['name'] == 'abc' &&
              request.query['pass'] == '123') {
            return await innerHandler(request);
          } else {
            return ResponseX.unauthorized('Authentication failed !!!');
          }
        };
      };

  @override
  void entryPoint() {
    var r1 = app.group('/v1');

    // var middleware = Pipeline().addMiddleware(verification()).middleware;
    r1.use(verification());
    r1.get('/hello', (Request request) {
      return Response.ok('hello-world');
    });

    r1.get('/greet/:name', (Request request, String name) {
      return Response.ok('Hi,$name');
    });

    var r2 = app.group('/v2');
    r2.get('/hello', (Request request) {
      return Response.ok('hello,arowana');
    });
    r2.get('/user/:name', (Request request, String user) {
      return Response.ok('hello, $user');
    });
  }

  @override
  FutureOr<Response> call(Request request) {
    print('current isolate [${Isolate.current.debugName}]');
    return app.call(request);
  }
}

void main() {
  var app = Application(MyAChannel());
  app.options = ApplicationOptions()..address = '127.0.0.1';
  app.start(numberOfInstances: 2,consoleLogging: true);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

You might also like...

An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

network_requests An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio. Platform Supported

Dec 15, 2022

A simple dart http server in Koa2 style

Dia A simple dart http server like KoaJS. This package allows you to create a http / http server in a couple of lines. Dia creates a context from a bu

Dec 18, 2022

A simple HTTP server that can serve up any directory, built with Dart

A simple HTTP server that can serve up any directory, built with Dart. Inspired by python -m SimpleHTTPServer. Install Use the dart pub global command

Dec 27, 2021

Powerful, helpfull, extensible and highly customizable API's that wrap http client to make communication easier with Axelor server with boilerplate code free.

Powerful, helpfull, extensible and highly customizable API's that wrap http client to make communication easier with Axelor server with boilerplate code free.

flutter_axelor_sdk Powerful, helpful, extensible and highly customizable API's that wrap http client to make communication easier with Axelor server w

Dec 25, 2022

Petit httpd - This is a simple HTTP file server integrated with Let's Encrypt, gzip and CORS

Petit httpd - This is a simple HTTP file server integrated with Let's Encrypt, gzip and CORS

Nov 24, 2022

Flying Fish is full-stack Dart framework - a semi-opinionated framework for building applications exclusively using Dart and Flutter

Flying Fish is full-stack Dart framework - a semi-opinionated framework for building applications exclusively using Dart and Flutter.

Dec 27, 2022

An expressive, functional, and full-featured server-side framework for Dart.

An expressive, functional, and full-featured server-side framework for Dart.

A framework and collection of packages for writing http servers, built on top of the shelf package. This framework is intended to reduce the technical

Jun 25, 2022

Dartness is a progressive dart framework for building efficient and scalable server-side applications

Dartness is a framework for building efficient, scalable dart server-side applications. It provides an easy and quick way to develop modern standalone server.

Dec 12, 2022

🦜 Parrot - A progressive Dart framework for building efficient, reliable and scalable server-side applications.

🦜 Parrot A progressive Dart framework for building efficient, reliable and scalable server-side applications. What is Parrot? Parrot is a Dart framew

Nov 11, 2022

Domain-Driven Design + Parse Server For FlutterDomain-Driven Design + Parse Server For Flutter

Domain-Driven Design + Parse Server For FlutterDomain-Driven Design + Parse Server For Flutter

Domain-Driven Design + Parse Server Install Parse SDK on Flutter project and then update .env file PARSE_APPLICATION_ID=YOUR_APP_ID_HERE PARSE_CLIENT_

Nov 18, 2022

Rokeet UI - A Server Driven UI Framework

Rokeet UI A Server-Driven UI framework. Status Lib Build Coverage Core Configure Mockoon server Install Mockoon: Mac OSX brew install --cask mockoon

Apr 7, 2022

A Flutter server rendering framework

Shark Flutter 🦈 (Under Construction) A Flutter server rendering framework After i finish the project structure, I would draw a project diagram and de

Dec 29, 2022

A performant, expressjs like server framework with a few gadgets that make life even easier.

Alfred A performant, expressjs like server framework thats easy to use and has all the bits in one place. Quickstart: import 'package:alfred/alfred.da

Jan 2, 2023

Modular server framework with ConnectMe (WebSockets + PackMe) and MongoDb support.

What is ServeMe ServeMe is a simple and powerful modular server framework. It allows to easily create backend services for both mobile and web applica

Dec 3, 2022

dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Jul 11, 2022

The ROHD Verification Framework is a hardware verification framework built upon ROHD for building testbenches.

The ROHD Verification Framework is a hardware verification framework built upon ROHD for building testbenches.

ROHD Verification Framework The ROHD Verification Framework (ROHD-VF) is a verification framework built upon the Rapid Open Hardware Development (ROHD

Dec 20, 2022

A powerful Http client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout etc.

dio_http A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout

Dec 19, 2021

Future based HTTP client for the Dart and Flutter

Uno Future based HTTP client for the Dart and Flutter. Uno, inspired by Axios, bringing a simple and robust experience to the crossplatform apps in Fl

Dec 16, 2022
Owner
arcticfox
公众号:编程之路从0到1
arcticfox
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Abdelrahman Saed 2 Jul 7, 2021
A simple dart http server in Koa2 style

Dia A simple dart http server like KoaJS. This package allows you to create a http / http server in a couple of lines. Dia creates a context from a bu

Andrey Unger 21 Dec 18, 2022
Liquidart is a Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider. Revival of the abandoned AQUEDUCT project.

Liquidart is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational map

Aldrin's Art Factory 35 Dec 27, 2022
server side dart micro-framework to handle incoming http requests

Queen Palace ???? Introduction server side dart micro-framework to handle incoming http requests

Ahmed Masoud 32 Aug 30, 2022
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Stable Kernel 2.4k Jan 5, 2023
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Abdelrahman Saed 2 Jul 7, 2021
A lightweight and customizable http client that allows you to create offline-first dart app easily.

Enjoyable & customizable offline-first REST API client Unruffled is lightweight and customizable http client that allows you to create offline-first e

T. Milian 3 May 20, 2022
App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and less verbose.

App HTTP Client App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and le

Joanna May 44 Nov 1, 2022
Charlatan - A library for configuring and providing fake http responses to your dio HTTP client.

charlatan This package provides the ability to configure and return fake HTTP responses from your Dio HTTP Client. This makes it easy to test the beha

Betterment 14 Nov 28, 2022
http_plus - a drop-in replacement for http with HTTP/2 goodies

http_plus is a drop-in replacement for http with HTTP/2 goodies! Under the hood, it wraps http2 to make it compatible with APIs of http. Additionally, it fallbacks to HTTP/1.1 if H2 is not supported by the server.

Harsh Bhikadia 7 Apr 22, 2022