You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,12 +38,17 @@ If you have any problems processing any Postgres related library on a Mac, try i
38
38
39
39
After the build you should be able to run the server using `~/.local/bin/postgres-websockets` (you can add `~/.local/bin` to your PATH variable):
40
40
41
-
To run the example bellow you will need a PostgreSQL server running on port 5432 of your localhost. You can also change the database connection string editting the `sample.conf` file.
41
+
To run the example bellow you will need a PostgreSQL server running on port 5432 of your localhost.
After running the above command, open your browser on http://localhost:3000 to see an example of usage.
48
53
49
54
The sample config file provided in the [sample.conf](https://github.com/diogob/postgres-websockets/tree/master/sample.conf) file comes with a jwt secret just for testing and is used in the sample client.
Env.parse (header "You need to configure some environment variables to start the service.") $
49
+
AppConfig<$> var (str <=< nonempty) "PGWS_DB_URI" (help "String to connect to PostgreSQL")
50
+
<*> var str "PGWS_ROOT_PATH" (def "./"<> helpDef show<> help "Root path to serve static files")
51
+
<*> var str "PGWS_HOST" (def "*4"<> helpDef show<> help "Address the server will listen for websocket connections")
52
+
<*> var auto "PGWS_PORT" (def 3000<> helpDef show<> help "Port the server will listen for websocket connections")
53
+
<*> var str "PGWS_LISTEN_CHANNEL" (def "postgres-websockets-listener"<> helpDef show<> help "Master channel used in the database to send or read messages in any notification channel")
54
+
<*> var str "PGWS_JWT_SECRET" (help "Secret used to sign JWT tokens used to open communications channels")
55
+
<*> var auto "PGWS_JWT_SECRET_BASE64" (def False<> helpDef show<> help "Indicate whether the JWT secret should be decoded from a base64 encoded string")
56
+
<*> var auto "PGWS_POOL_SIZE" (def 10<> helpDef show<> help "How many connection to the database should be used by the connection pool")
0 commit comments