dart pub add dartcore
Introducing Dartcore:
Dartcore is designed to work on any machine, and also is easy-to-use, and Flask-like!
Dartcore makes fast apps that work on any machine. It's built with Dart, a language designed for fast apps
Simple to write; fast to run.
import 'package:dartcore/dartcore.dart' as dartcore;
void main() async {
final app = dartcore.App();
app.get( "/", (req, res) async {
await res.json({"hello": "world"});
});
await app.start(port: 8080);
}
Don't fight the browser. Dartcore helps you handle form submissions and other dynamic requests server-side, from any route.
Forms in Dartcore
import 'package:dartcore/dartcore.dart' as dartcore;
void main() async {
final app = dartcore.App();
app.get( '/form', (request, response) async {
await response.htmk(request, """
<form action="/" method="POST" class="text-left md:px-8">
<fieldset class="mb-4">
<legend class="mb-2 font-bold">What's your favorite treat?</legend>
<label for="lemon-meringue-pie" class="flex gap-2 items-center">
<input type="radio" value="lemon-meringue-pie" id="lemon-meringue-pie" name="treat" checked="">
Lemon meringue pie</label>
<label for="lemon-shortbread-cookies" class="flex gap-2 items-center">
<input type="radio" value="lemon-shortbread-cookies" id="lemon-shortbread-cookies" name="treat">
Lemon shortbread cookies</label>
<label for="lemon-sherbet" class="flex gap-2 items-center">
<input type="radio" value="lemon-sherbet" id="lemon-sherbet" name="treat">
Lemon sherbet</label>
<label for="lemon-bars" class="flex gap-2 items-center">
<input type="radio" value="lemon-bars" id="lemon-bars" name="treat">
Lemon bars</label>
</fieldset>
<button type="submit" value="Submit" class="pt-2 pb-1 px-3 rounded border-current border-[1.5px] font-semibold">
Submit</button>
</form>
""" );
});
await app.start(port: 8080);
}
Jump right in and build your website/server with Dartcore. Learn everything you need to know in seconds.
Get started