-
Notifications
You must be signed in to change notification settings - Fork 4
1.Quick start
Before we begin, it is necessary to prepare your work environment. Let's see:
Follow the steps in this tutorial.
Make sure thats your environment’s path variable is updated and working.
In your terminal, run
$ pub global activate protoc_plugin
And then add .pub-cache/bin
in your home dir to your PATH
if you haven't already.
To more information, see this.
In your terminal, run
$ pub global activate upper
And then add .pub-cache/bin
in your home dir to your PATH
if you haven't already.
To create your project, you will need a valid connection to a Postgres database. A DbaaS databases (e.g. Heroku) can be used.
Use the create command to create your project. The first parameter of this command is the name of the project. This name will be used to create the application's root folder and also for other things. The other required parameters are the connection to your Postgres database.
upper create <project_name> -host <hostname> -port <port_number> -database <database_name> -user <postgres_user_name> -password <password>
Note: Navigate to a folder of your projects before executing the create command. Or, if you prefer, use the -path parameter to specify in which folder the project should be created.
upper create <project_name> -path <path_to_create> -host ...
See this example:
upper create dvdrental -host 127.0.0.1 -port 5432 -database dvdrental -user postgres -password 1234
See in your disk:
Open in your IDE, and locate the file bin/server.dart
Run it and see this message:
Now, let's try to consume our API using a gRPC tool like BloomRPC (Similar to Postman).
Open it and click in the import protos
button:
Navigate to sub-folder protos of your project and select one or more protofiles to import:
Now, select a service and a method do execute:
Enter the address and port of your local machine, alter the offset to 0 and prees the execute button
:
See the response of select method. In this case, two records are selected:
Expand the data
object and see the selected actors:
Now, feel free to try the other methods and services.