mid 0.0.3
mid: ^0.0.3 copied to clipboard
a tool for building an end-to-end typesafe APIs in pure dart
example/README.md
Quick Start Tutorial #
This is a quick start tutorial that's meant to show how mid works.
-
Install
midif you haven't:dart pub global activate mid -
Create a
midproject:mid create quick_startThis will create two dart projects in the following structure:
quick_start |- quick_start_client |- quick_start_server -
Open the project in your favorite IDE:
code quick_start -
Head to
quick_start_server/lib/mid/endpoints.dartfile:a. remove existing code.
b. then paste the following:
// TODO: put endpoints here -
Generate the server and client code:
mid generate all -
Head to
quick_start_client/bin/and createfrontend.dart:Assume this file is your frontend project. Paste the following there:
// TODO: put client code -
Run the frontend app (assuming you're still within
quick_startdirectory):dart run quick_start_client/bin/frontend.dartThis should print the following:
file an issue if it doesn't 😅