Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastiaanyn/rmr
A simple to use web server framework for Dart
https://github.com/sebastiaanyn/rmr
backend dart dart-frameworks dart-library
Last synced: 25 days ago
JSON representation
A simple to use web server framework for Dart
- Host: GitHub
- URL: https://github.com/sebastiaanyn/rmr
- Owner: SebastiaanYN
- License: isc
- Created: 2018-10-26T21:12:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-26T21:14:01.000Z (about 6 years ago)
- Last Synced: 2024-10-28T20:49:37.241Z (2 months ago)
- Topics: backend, dart, dart-frameworks, dart-library
- Language: Dart
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Web server framework for Dart
**RMR** allows you to easily create a scalable server backend for your web applications.## Example
See `example/example.dart`
```dart
import 'dart:io';import 'package:rmr/rmr.dart';
void main() async {
Server server = Server();server.get(Path('/'), [
(rmr) {
print('Got a request on ${rmr.req.uri}');
rmr.next();
},
(rmr) {
rmr.html(HttpStatus.ok, 'Hello from RMR
');
}
]);server.listen(InternetAddress.loopbackIPv4, 4040, (server) {
print('Listening on ${server.address} port ${server.port}');
});
}
```## Handlers and Middleware
**RMR** is a middleware based framework. This means requests can be handled in separate parts allowing you to group
common functionality together. When `rmr.next()` is called execution is passed on to the next handler. **RMR** also hides
a lot of the ugly code that comes with writing a server by providing some handy shortcuts. Such as listening for specific
request methods and paths, sending `html`, `css`, `js` and `json` data to the client and more.