We will now set up PostgREST so that whenever we start our ec2 instance, the API service will automatically start:
- We will configure PostgREST as a service with the help of the following command:
[root@ip-172-31-95-213 postgrest]# mkdir /etc/postgrest
[root@ip-172-31-95-213 postgrest]# vi /etc/postgrest/config
------------------------------------------
db-uri = "postgres://dba:bookdemo@atm.ck5074bwbilj.us-east-1.rds.amazonaws.com/atm"
db-schema = "public"
db-anon-role = "web_anon"
db-pool = 10
server-host = "127.0.0.1"
server-port = 3000
jwt-secret = "DFZ49GQGubpzcSbt3t2uMIiBF6pU4PJ8"
------------------------------------------
After the preceding command is executed, the console will look as shown in Figure 6.15:
Figure 6.15 – Configuring PostgREST as a service
- Then create the systemd service file by using the following command:
[root@ip-172-31-95-213 postgrest]# ln -s /usr/local/bin/postgrest...