astra 1.0.0-dev.159 astra: ^1.0.0-dev.159 copied to clipboard
A robust, multi-threaded shelf web server adapter designed for high performance and concurrent handling of multiple requests.
A robust, multi-threaded shelf web server adapter designed for
high performance and concurrent handling of multiple requests.
Inspired by aqueduct, uvicorn and starlette.
WORK IN PROGRESS
ToDo #
- Enhance API documentation 🔥
- Logging 🔥
- Write more tests 🔥
- ...
Experimenting #
- Exploring
Request
/Response
basedHttpServer
alternatives 🤔 - Adding
HTTP/2
support - ...
Quickstart #
Create an application in the lib/[package].dart
file:
import 'dart:io';
import 'package:astra/core.dart';
Response application(Request request) {
return Response.ok('hello world!');
}
and the bin/main.dart
file:
import 'package:astra/serve.dart';
import 'package:example/example.dart';
Future<void> main() async {
var server = await application.serve('localhost', 8080);
print('Serving at ${server.url} ...');
}
to run application.