From 6ed376ffae62a4a11b824fc67d554e7062507eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sat, 28 Jan 2023 07:00:07 +0100 Subject: [PATCH] make port easier to change --- README.md | 1 + server.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7da1a1e..4f59b66 100644 --- a/README.md +++ b/README.md @@ -70,5 +70,6 @@ mysql --user=partdb --password=password --database=partdb < schema.sql put the database access information in `credentials.json` and run `server.rb`. now go to http://localhost:4244 and you are ready to use it. +the port is defined in `server.rb`. use a proxy web server to handle the authentication, TLS, compression, ... diff --git a/server.rb b/server.rb index 037d40d..d7482b9 100755 --- a/server.rb +++ b/server.rb @@ -26,6 +26,8 @@ CREDENTIALS = "credentials.json" PUBLIC = "public" # folder name for part attachments (in PUBLIC) ATTACHMENTS = "attachments" +# port for this service +PORT = 4244 raise "database information #{CREDENTIALS} do not exist" unless File.file? CREDENTIALS @@ -42,7 +44,7 @@ configure do set :protection, :except => :json_csrf set :bind, 'localhost' - set :port, 4244 + set :port, PORT set :public_folder, "public" set :static, true end