astra 1.0.0-dev.150 astra: ^1.0.0-dev.150 copied to clipboard
Astra is Shelf web server adapter and application framework.
Astra is Shelf web server adapter and application framework. Multi-isolate support and hot reload/restart. Inspired by uvicorn and starlette.
WORK IN PROGRESS
ToDo #
- Verbose output 🔥
- More API Documentation 🔥
- Logging 🔥
- Tests 🔥
- Environment variables & configuration file
- ...
Experimenting #
- Shelf Request/Response based HttpServer alternatives:
- dart:io Socket (without HttpRequest/HttpResponse, ...) 🤔
- dart:ffi and Go/Rust web server adapter 🤔
- ...
- HTTP/2 🤔
- ...
Quickstart #
Create an application in lib/[package].dart
file
import 'dart:io';
import 'package:astra/core.dart';
Response application(Request request) {
return Response.ok('hello world!');
}
and 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.