astra 1.0.0-dev.153 astra: ^1.0.0-dev.153 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 #
- More API Documentation 🔥
- Logging 🔥
- Tests 🔥
- ...
Experimenting #
- Shelf
Request
/Response
basedHttpServer
alternatives:dart:io
Socket
(withoutHttpRequest
/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.