Template of a C++ service that uses userver framework with PostgreSQL.
To create your own userver-based service follow the following steps:
- Press the "Use this template button" at the top right of this GitHub page
- Clone the service
git clone your-service-repo && cd your-service-repo
- Give a proper name to your service and replace all the occurrences of "service_template" string with that name
(could be done via
find . -not -path "./third_party/*" -not -path ".git/*" -not -path './build-*' -type f | xargs sed -i 's/service_template/YOUR_SERVICE_NAME/g'
). - Feel free to tweak, adjust or fully rewrite the source code of your service.
PRESET
is either debug
, release
, or if you've added custom presets in CMakeUserPresets.json
, it
can also be debug-custom
, release-custom
.
make cmake-PRESET
- run cmake configure, update cmake options and source file listsmake build-PRESET
- build the servicemake test-PRESET
- build the service and run all testsmake start-PRESET
- build the service, start it in testsuite environment and leave it runningmake install-PRESET
- build the service and install it in directory set in environmentPREFIX
make
ormake all
- build and run all tests indebug
andrelease
modesmake format
- reformat all C++ and Python sourcesmake dist-clean
- clean build files and cmake cachemake docker-COMMAND
- runmake COMMAND
in docker environmentmake docker-clean-data
- stop docker containers and clean database data
The original template is distributed under the Apache-2.0 License and CLA. Services based on the template may change the license and CLA.