Simple REST service using cpprestsdk and PostgreSQL.
Set $CMAKE_INSTALL_PREFIX variable to '/opt/cpp-rest-service'.
Make a file named 'db_connection_string' containing only PostgreSQL connection string in '$CMAKE_INSTALL_PREFIX/cfg/'. And then just run cpp-rest-service executable. For example:
dbname=cpp-rest-service user=postgres
To build docker image:
- Install project in '/opt/cpp-rest-service'.
- Go to 'docker' directory in sources.
- Run 'build_docker.sh'.
To start docker just run 'run_docker.sh'.
- Install with:
sudo pacman -S postgresql
- Then configure with:
sudo su postgres -l
initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'
exit
- Start and enable postgresql.service:
sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service
- Create DB and user:
sudo su postgres -l
createuser --interactive
createdb cpp-rest-service
exit