From a1171e94314982886736768aca4c6aa04297287a Mon Sep 17 00:00:00 2001 From: blankie Date: Mon, 10 Apr 2023 21:20:29 +0700 Subject: [PATCH] Don't set ignore_comments for compatibility with nlohmann::json versions < 3.9 --- RUNNING.md | 5 ++++- config.cpp | 2 +- example_config.json | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/RUNNING.md b/RUNNING.md index 15d8d84..f822f9e 100644 --- a/RUNNING.md +++ b/RUNNING.md @@ -12,7 +12,10 @@ Copy `example_config.json` to a file with any name you like (e.g. `config.json`), then open the copied file and edit the parameters to your -liking (they should be self-explanatory, especially with comments). +liking. Here's a list of what they are: +- `bind_host` (string): What address to bind to +- `bind_port` (zero or positive integer): What port to bind to +- `image_proxy_url` (string): URL to proxy images to (see https://pixiv.cat/reverseproxy.html), a trailing slash is not needed Pixwhile is intended to be run behind a reverse proxy (e.g. Nginx), so you should set your reverse proxy to proxy requests to diff --git a/config.cpp b/config.cpp index adc0838..c136e33 100644 --- a/config.cpp +++ b/config.cpp @@ -5,7 +5,7 @@ Config load_config(const char* path) { File config_file(path, "r"); - return nlohmann::json::parse(config_file.get(), nullptr, true, true); + return nlohmann::json::parse(config_file.get()); } void from_json(const nlohmann::json& j, Config& config) { diff --git a/example_config.json b/example_config.json index 39f4d5c..6bf1cd8 100644 --- a/example_config.json +++ b/example_config.json @@ -1,5 +1,5 @@ { - "bind_host": "127.0.0.1", // string: What address to bind to - "bind_port": 8080, // integer: What port to bind to - "image_proxy_url": "https://i.pixiv.cat" // string: URL to proxy images to (see https://pixiv.cat/reverseproxy.html), a trailing slash is not needed + "bind_host": "127.0.0.1", + "bind_port": 8080, + "image_proxy_url": "https://i.pixiv.cat" }