Added rake task to start server in a more production-ready manner using Puma; move config values to config directory

This commit is contained in:
2023-03-09 23:22:18 -05:00
parent 39ce636c0a
commit 0927a00960
7 changed files with 22 additions and 8 deletions

10
config/defaults.yaml Normal file
View File

@@ -0,0 +1,10 @@
stgm:
base_directory: '/srv/videos'
server:
address: '127.0.0.1'
port: 4567
database:
adapter: 'sqlite'
database: 'data/stgm.db'

6
config/puma.rb Normal file
View File

@@ -0,0 +1,6 @@
# Load application config
require './app/config.rb'
$conf = Config.new(File.join(__dir__, 'config/config.yaml'))
bind_address = "tcp://#{$conf.get('server.address')}:#{$conf.get('server.port')}"
bind bind_address