We are now putting together what we have set up until now, the database schema, the user role, and the PostgreSQL version 12 connection of the RDS, into PostgREST in the following steps:
- We will create the PostgREST configuration file as shown and will name it tutorial.conf:
[root@ip-172-31-95-213 src]# mkdir postgrest
[root@ip-172-31-95-213 src]# cd postgrest
[root@ip-172-31-95-213 postgrest]# vi tutorial.conf
db-uri = "postgres://dba:[email protected]/atm" db-schema = "public" db-anon-role = "web_anon"
- Now, we will call PostgREST to create an API on our RDS with the help of the following command:
[root@ip-172-31-95-213 postgrest]# postgrest tutorial.conf
PostgREST will start listening on port 3000 after it is connected to the RDS, hence the automatic API on the ATM database has been established. After you run the preceding command, your console will look as shown in the following screenshot...