Add redis connection to config

- Add a config property for the redis connection uri
pull/4/head
trivernis 5 years ago
parent b1ec17b9d7
commit 57ee014bd6

@ -1,26 +1,40 @@
# Configuration of the database connection # Configuration of the database connection
[database] [database]
# A connection uri string to the database
connectionUri = "sqlite://greenvironment.db" connectionUri = "sqlite://greenvironment.db"
# Configuration for the redis connection
[redis]
# A connection uri string to the redis server
connectionUri = "redis://localhost:6379"
# Configuration of the http server # Configuration of the http server
[server] [server]
# The port the server is running on
port = 8080 port = 8080
# Allow cross origin requests
cors = false cors = false
# Configuration for the sessions # Configuration for the sessions
[session] [session]
# A secret that is used for the sessions. Must be secure
secret = "REPLACE WITH SAFE RANDOM GENERATED SECRET" secret = "REPLACE WITH SAFE RANDOM GENERATED SECRET"
# The maximum age of a cookie. The age is reset with every request of the client
cookieMaxAge = 6048e+5 # 7 days cookieMaxAge = 6048e+5 # 7 days
# Configuration for markdown rendering # Configuration for markdown rendering
[markdown] [markdown]
# The plugins used in the markdown parser
plugins = ["markdown-it-emoji"] plugins = ["markdown-it-emoji"]
# Configuration for logging # Configuration for logging
[logging] [logging]
# The loglevel
level = "info" level = "info"
# Configuration for the frontend files # Configuration for the frontend files
[frontend] [frontend]
# The path to the angular index file. Its relative to the public path.
angularIndex = "index.html" angularIndex = "index.html"
# The path to the public files
publicPath = "./public" publicPath = "./public"

@ -94,7 +94,7 @@ class App {
this.sequelize.options.logging = (msg) => logger.silly(msg); this.sequelize.options.logging = (msg) => logger.silly(msg);
logger.info("Setting up socket.io"); logger.info("Setting up socket.io");
try { try {
this.io.adapter(socketIoRedis()); this.io.adapter(socketIoRedis(config.get("redis.connectionUri")));
} catch (err) { } catch (err) {
logger.error(err.message); logger.error(err.message);
logger.debug(err.stack); logger.debug(err.stack);

Loading…
Cancel
Save