diff --git a/.gitignore b/.gitignore index 69ce43a..9abf56c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ x64 log pgsql +config.json # Prerequisites *.d diff --git a/README.md b/README.md index c873925..36081fc 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,21 @@ *A Boost Based C++ HTTP JSON Server.* +## Dependencies + +- VS2019 +- CMake +- PostgreSQL + > *The database may not be installed locally. You should be able to connect to it.* +- Other Dependencies + > Refer to [readme](/dependencies/README.md) for setting up other dependencies. + + ## Quick Start +Use VS2019 to open `WebApp/WebApp.sln`, which is a sample project. [`config-example.json`](config-example.json) is a sample config file for `WebApp`'s startup parameters. **It should be renamed to `config.json` before you `Run` the project.** + + ### Database You can import the sample database: @@ -18,9 +31,3 @@ You can import the sample database: ``` psql bserv < db.sql ``` - - -## Build - -Refer to [readme](/dependencies/README.md) for setting up dependencies. - diff --git a/config.json b/config-example.json similarity index 65% rename from config.json rename to config-example.json index 9eddd1b..8ecc295 100644 --- a/config.json +++ b/config-example.json @@ -2,7 +2,7 @@ "port": 8080, "thread-num": 2, "conn-num": 4, - "conn-str": "postgresql://username:password@localhost:5432/bserv", + "conn-str": "postgresql://[username]:[password]@[url]:[port]/[db]", "static_root": "../../templates/statics", "template_root": "../../templates" } \ No newline at end of file diff --git a/dependencies/README.md b/dependencies/README.md index 7cf9ea5..38d6924 100644 --- a/dependencies/README.md +++ b/dependencies/README.md @@ -5,7 +5,6 @@ CMD: ``` -git clone --single-branch --branch master --recursive https://github.com/boostorg/boost.git cd boost bootstrap b2 @@ -14,11 +13,6 @@ b2 ## [Crypto++](https://cryptopp.com/) -CMD: -``` -git clone https://github.com/weidai11/cryptopp.git -``` - 1. Go to `cryptopp`. 2. Use VS2019 to open `cryptest.sln`. 3. For `Debug` `x64` configuration, open `Properties` of `cryptlib` project. In `C/C++` `Code Generation`, set `Runtime Library` to `Multithreading Debug DLL (/MDd)`. @@ -34,11 +28,6 @@ git clone https://github.com/weidai11/cryptopp.git # [Libpqxx](https://github.com/jtv/libpqxx) -CMD: -``` -git clone https://github.com/jtv/libpqxx.git -``` - 1. Go to `libpqxx`. 2. Use `cmake-gui`: - `Browse Source...` and `Browse Build...` to the root directory of `libpqxx`. @@ -52,7 +41,4 @@ git clone https://github.com/jtv/libpqxx.git # [inja](https://github.com/pantor/inja) -CMD: -``` -git clone https://github.com/pantor/inja.git -``` +*Nothing should be done...*