{"id":13418079,"url":"https://github.com/pistacheio/pistache","last_synced_at":"2025-05-13T17:06:04.470Z","repository":{"id":36316117,"uuid":"40620758","full_name":"pistacheio/pistache","owner":"pistacheio","description":"A high-performance REST toolkit written in C++","archived":false,"fork":false,"pushed_at":"2025-03-29T04:22:00.000Z","size":7794,"stargazers_count":3319,"open_issues_count":218,"forks_count":715,"subscribers_count":113,"default_branch":"master","last_synced_at":"2025-04-23T23:17:23.954Z","etag":null,"topics":["api-rest","server"],"latest_commit_sha":null,"homepage":"https://pistacheio.github.io/pistache/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pistacheio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-12T19:44:15.000Z","updated_at":"2025-04-23T20:41:55.000Z","dependencies_parsed_at":"2023-09-25T00:23:10.212Z","dependency_job_id":"7b4a8c85-59f0-4539-80f1-199284ea60ec","html_url":"https://github.com/pistacheio/pistache","commit_stats":null,"previous_names":["oktal/pistache"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pistacheio%2Fpistache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pistacheio%2Fpistache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pistacheio%2Fpistache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pistacheio%2Fpistache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pistacheio","download_url":"https://codeload.github.com/pistacheio/pistache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528902,"owners_count":21445519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","server"],"created_at":"2024-07-30T22:00:58.286Z","updated_at":"2025-04-23T23:17:28.722Z","avatar_url":"https://github.com/pistacheio.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","C++"],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2016 Mathieu Stefani\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\n# Pistache\n\n[![N|Solid](pistache.io/static/img/logo.png)](https://www.github.com/pistacheio/pistache)\n\n[![linux](https://github.com/pistacheio/pistache/actions/workflows/linux.yaml/badge.svg)](https://github.com/pistacheio/pistache/actions/workflows/linux.yaml)\n[![autopkgtest](https://github.com/pistacheio/pistache/actions/workflows/autopkgtest.yaml/badge.svg)](https://github.com/pistacheio/pistache/actions/workflows/autopkgtest.yaml)\n[![codecov](https://codecov.io/gh/pistacheio/pistache/branch/master/graph/badge.svg)](https://codecov.io/gh/pistacheio/pistache)\n[![REUSE status](https://api.reuse.software/badge/github.com/pistacheio/pistache)](https://api.reuse.software/info/github.com/pistacheio/pistache)\n\nPistache is a modern and elegant HTTP and REST framework for C++. It is entirely written in pure-C++17[\\*](#linux-only) and provides a clear and pleasant API.\n\nPistache supports Linux, macOS, Windows and BSD (FreeBSD, OpenBSD, and\nNetBSD). To use in macOS, Windows, or BSD, see the respective files:\n*Building on macOS.txt*, *Building on Windows.txt* or *Building on BSD.txt*.\n\n## Documentation\n\nWe are still looking for a volunteer to document fully the API. In the mean time, partial documentation is available at [pistacheio.github.io/pistache/](https://pistacheio.github.io/pistache/). If you are interested in helping with this, please open an issue ticket.\n\nA benchmark comparison of Pistache to other C++ RESTful APIs was created by guteksan and is available [here](https://github.com/guteksan/REST-CPP-benchmark).\n\n## Articles, Tutorials \u0026 Videos\n\n* [Building an API in C++ With Pistache](https://levelup.gitconnected.com/building-an-api-in-c-with-pistache-413247535fd3)\n* [Adding a REST API with Pistache](https://www.youtube.com/watch?v=9BCO5W_Kw3Q)\n* [Slim Microservices with Pistache](https://www.dev-insider.de/schlanke-microservices-mit-pistache-a-87155e2f183e637103e19708200f8931/) (German)\n\n## Dependencies\n\nPistache has the following third party dependencies\n\n- [Meson](https://mesonbuild.com)\n- [Doxygen](https://www.doxygen.nl/)\n- [Googletest](https://github.com/google/googletest)\n- [OpenSSL](https://www.openssl.org/)\n- [RapidJSON](https://rapidjson.org/)\n- [Hinnant Date](https://github.com/HowardHinnant/date)\n- [brotli](https://www.brotli.org/)\n- [zstd](https://github.com/facebook/zstd)\n- [libevent](https://libevent.org/)\n\n## Contributing\n\nPistache is released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). Contributors are welcome!\n\nPistache was originally created by Mathieu Stefani (`@octal`). He continues to contribute to the maintainence and development of Pistache, supported by a team of volunteers. The maintainers can be reached  in `#pistache` on [Libera.Chat](https://libera.chat/) (ircs://irc.libera.chat:6697). Please come and join us!\n\nThe [Launchpad Team](https://launchpad.net/~pistache+team) administers the daily and stable Ubuntu pre-compiled packages.\n\n### Versioning\n\nThe version of the library's public interface (ABI) is not the same as the release version, but we plan to always guarantee that the major release version and the soname version will match after the 1.0 release; until that, the soname version will follow feature releases. The interface version is primarily associated with the _external_ interface of the library. Different platforms handle this differently, such as AIX, GNU/Linux, and Solaris.\n\nGNU Libtool abstracts each platform's idiosyncrasies away because it is more portable than using `ar(1)` or `ranlib(1)` directly. However, it is [not supported in Meson](https://mesonbuild.com/FAQ.html#how-do-i-do-the-equivalent-of-libtools-exportsymbol-and-exportregex) so we made do without it by setting the SONAME directly.\n\nWhen Pistache is installed it will normally ship:\n\n- `libpistache.so.X.Y.Z`: This is the actual shared-library binary file. The _X_, _Y_ and _Z_ values are the major, minor and patch interface versions respectively.\n\n- `libpistache.so.X.Y`: This is the _soname_ soft link that points to the binary file. It is what other programs and other libraries reference internally. You should never need to directly reference this file in your build environment.\n\n- `libpistache.so`: This is the _linker name_ entry. This is also a soft link that refers to the soname with the highest major interface version. This linker name is what is referred to on the linker command line.\n\n- `libpistache.a`: This is the _static archive_ form of the library. Since when using a static library all of its symbols are normally resolved before runtime, an interface version in the filename is unnecessary.\n\nIf your contribution has modified the interface, you may need to update the major or minor interface versions. Otherwise user applications and build environments will eventually break. This is because they will attempt to link against an incorrect version of the library -- or worse, link correctly but with undefined runtime behaviour.\n\nThe major version should be incremented when you make incompatible API or ABI changes. The minor version should be incremented when you add functionality in a backwards compatible manner. The patch version should be incremented when you make backwards compatible bug fixes. This can be done by modifying `version.txt` accordingly. Also remember to always update the commit date in the aformentioned file.\n\n## Precompiled Packages\n\nIf you have no need to modify the Pistache source, you are strongly recommended to use precompiled packages for your distribution. This will save you time.\n\n### Debian and Ubuntu\n\nPistache is available in the official repositories since Debian 12 and Ubuntu 23.10, under the package name `libpistache-dev`.\n\n### macOS\n\nPistache can be installed using the Homebrew package manager. See *Building on macOS.txt* for specifics.\n\n#### Supported Architectures\n\nCurrently Pistache is built and tested on a number of [architectures](https://wiki.debian.org/SupportedArchitectures). Some of these are suitable for desktop or server use and others for embedded environments. As of this writing we do not currently have any MIPS related packages that have been either built or tested.\n\n- amd64\n- arm64\n- armhf\n- i386\n- ppc64el\n- riscv64\n- s390x\n\n### Ubuntu PPA (Unstable)\n\nThe project builds [daily unstable snapshots](https://launchpad.net/~pistache+team/+archive/ubuntu/unstable) in a separate unstable PPA. To use it, run the following:\n\n```sh\n$ sudo add-apt-repository ppa:pistache+team/unstable\n$ sudo apt update\n$ sudo apt install libpistache-dev\n```\n\n### Ubuntu PPA (Stable)\n\nFrom time to time, the project transfers release packages into the [stable](https://launchpad.net/~pistache+team/+archive/ubuntu/stable) PPA. Run the following to install a stable package:\n\n```sh\n$ sudo add-apt-repository ppa:pistache+team/stable\n$ sudo apt update\n$ sudo apt install libpistache-dev\n```\n\n### Other Distributions\n\nPackage maintainers, please insert instructions for users to install pre-compiled packages from your respective repositories here.\n\n## Use via pkg-config\n\nIf you would like to automatically have your project's build environment use the appropriate compiler and linker build flags, [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) can greatly simplify things. It is the portable international _de facto_ standard for determining build flags. The development packages include a pkg-config manifest.\n\n### GNU Autotools\n\nTo [use](https://autotools.io/pkgconfig/pkg_check_modules.html) with the GNU Autotools, as an example, include the following snippet in your project's `configure.ac`:\n\n```makefile\n# Pistache...\nPKG_CHECK_MODULES(\n    [libpistache], [libpistache \u003e= 0.0.2], [],\n    [AC_MSG_ERROR([libpistache \u003e= 0.0.2 missing...])])\nYOURPROJECT_CXXFLAGS=\"$YOURPROJECT_CXXFLAGS $libpistache_CFLAGS\"\nYOURPROJECT_LIBS=\"$YOURPROJECT_LIBS $libpistache_LIBS\"\n```\n\n### Meson\n\nTo use with Meson, you just need to add `dependency('libpistache')` as a dependency for your executable.\n\n```meson\nproject(\n    'MyPistacheProject',\n    'cpp',\n    meson_version: '\u003e=0.55.0'\n)\n\nexecutable(\n    'MyPistacheExecutable',\n    sources: 'main.cpp',\n    dependencies: dependency('libpistache')\n)\n```\n\nIf you want to build the library from source in case the dependency is not found on the system, you can add this repository as a submodule in the `subprojects` directory of your project, and edit the `dependency()` call as follows:\n\n```meson\ndependency('libpistache', fallback: 'pistache')\n```\n\nIf you're using a Meson version older than 0.55.0 you'll have to use the \"older\" syntax for `dependency()`:\n\n```meson\ndependency('libpistache', fallback: ['pistache', 'pistache_dep'])\n```\n\nLastly, if you'd like to build the fallback as a static library you can specify it with the `default_options` keyword:\n\n```meson\ndependency('libpistache', fallback: 'pistache', default_options: 'default_library=static')\n```\n\n### CMake\n\nTo use with a CMake build environment, use the [FindPkgConfig](https://cmake.org/cmake/help/latest/module/FindPkgConfig.html) module. Here is an example:\n\n```cmake\ncmake_minimum_required(VERSION 3.6)\nproject(\"MyPistacheProject\")\n\nfind_package(PkgConfig)\npkg_check_modules(Pistache REQUIRED IMPORTED_TARGET libpistache)\n\nadd_executable(${PROJECT_NAME} main.cpp)\ntarget_link_libraries(${PROJECT_NAME} PkgConfig::Pistache)\n```\n\n### Makefile\n\nTo use within a vanilla makefile, you can call `pkg-config` directly to supply compiler and linker flags using shell substitution.\n\n```makefile\nCFLAGS=-g3 -Wall -Wextra -Werror ...\nLDFLAGS=-lfoo ...\n...\nCFLAGS+= $(pkg-config --cflags libpistache)\nLDFLAGS+= $(pkg-config --libs libpistache)\n```\n\n## Building from source\n\nTo download the latest available release, clone the repository over GitHub.\n\n```sh\n$ git clone https://github.com/pistacheio/pistache.git\n```\n\nTo build on macOS, Windows, or BSD, see the respective files *Building on macOS.txt*, *Building on Windows.txt* or *Building on BSD.txt*.\n\nContinuing the Linux instructions:\n\nNow, compile the sources:\n\n```sh\n$ cd pistache\n$ meson setup build                                 \\\n    --buildtype=release                             \\\n    -DPISTACHE_USE_SSL=true                         \\\n    -DPISTACHE_BUILD_EXAMPLES=true                  \\\n    -DPISTACHE_BUILD_TESTS=true                     \\\n    -DPISTACHE_BUILD_DOCS=false                     \\\n    -DPISTACHE_USE_CONTENT_ENCODING_BROTLI=true     \\\n    -DPISTACHE_USE_CONTENT_ENCODING_DEFLATE=true    \\\n    -DPISTACHE_USE_CONTENT_ENCODING_ZSTD=true    \\\n    --prefix=\"$PWD/prefix\"\n$ meson compile -C build\n$ meson install -C build\n```\n\nOptionally, you can also run the tests. You can skip tests requiring network access with `--no-suite=network`:\n\n```sh\n$ meson test -C build\n```\n\nBe patient, async_test can take some time before completing. And that's it, now you can start playing with your newly installed Pistache framework.\n\nSome other Meson options:\n\n| Option                                | Default | Description                                    |\n| ------------------------------------- | ------- | ---------------------------------------------- |\n| PISTACHE_USE_SSL                      | False   | Build server with SSL support                  |\n| PISTACHE_BUILD_TESTS                  | False   | Build all of the unit tests                    |\n| PISTACHE_BUILD_EXAMPLES               | False   | Build all of the example apps                  |\n| PISTACHE_BUILD_DOCS                   | False   | Build Doxygen docs                             |\n| PISTACHE_USE_CONTENT_ENCODING_BROTLI  | False   | Build with Brotli content encoding support     |\n| PISTACHE_USE_CONTENT_ENCODING_DEFLATE | False   | Build with deflate content encoding support    |\n| PISTACHE_USE_CONTENT_ENCODING_ZSTD    | False   | Build with zstd content encoding support       |\n\n## Example\n\n### Hello World (server)\n\n```cpp\n#include \u003cpistache/endpoint.h\u003e\n\nusing namespace Pistache;\n\nstruct HelloHandler : public Http::Handler {\n  HTTP_PROTOTYPE(HelloHandler)\n  void onRequest(const Http::Request\u0026, Http::ResponseWriter writer) override {\n    writer.send(Http::Code::Ok, \"Hello, World!\");\n  }\n};\n\nint main() {\n  Http::listenAndServe\u003cHelloHandler\u003e(Pistache::Address(\"*:9080\"));\n}\n```\n\n## Tutorials\n\n* [Adding a REST API with Pistache](https://www.youtube.com/watch?v=9BCO5W_Kw3Q), Utah Cpp Programmers, 20 July 2022.\n\n## Project status\n\nPistache hasn't yet hit the 1.0 release. This means that the project is _unstable_ but not _unusable_. In fact, most of the code is production ready; you can use Pistache to develop a RESTful API without issues, but the HTTP client has a few issues in it that make it buggy.\n\n\u003cb id=\"linux-only\"\u003e\\*\u003c/b\u003e While most code uses modern C++, Pistache makes use of some platform-specific APIs where the standard library doesn't provide alternatives. If you know how to help, please contribute a PR to add support for your desired platform :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistacheio%2Fpistache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpistacheio%2Fpistache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistacheio%2Fpistache/lists"}