<!--
SPDX-FileCopyrightText: 2016 Mathieu Stefani
SPDX-License-Identifier: Apache-2.0
-->
# Pistache
[![N|Solid](pistache.io/static/img/logo.png)](https://www.github.com/pistacheio/pistache)
[![linux](https://github.com/pistacheio/pistache/actions/workflows/linux.yaml/badge.svg)](https://github.com/pistacheio/pistache/actions/workflows/linux.yaml)
[![autopkgtest](https://github.com/pistacheio/pistache/actions/workflows/autopkgtest.yaml/badge.svg)](https://github.com/pistacheio/pistache/actions/workflows/autopkgtest.yaml)
[![codecov](https://codecov.io/gh/pistacheio/pistache/branch/master/graph/badge.svg)](https://codecov.io/gh/pistacheio/pistache)
[![REUSE status](https://api.reuse.software/badge/github.com/pistacheio/pistache)](https://api.reuse.software/info/github.com/pistacheio/pistache)
Pistache 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.
## Documentation
We 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.
A comparison of Pistache to other C++ RESTful APIs was created by guteksan and is available [here](https://github.com/guteksan/REST-CPP-benchmark).
## Dependencies
Pistache has the following third party dependencies
- [Meson](https://mesonbuild.com)
- [Doxygen](https://www.doxygen.nl/)
- [Googletest](https://github.com/google/googletest)
- [OpenSSL](https://www.openssl.org/)
- [RapidJSON](https://rapidjson.org/)
- [Hinnant Date](https://github.com/HowardHinnant/date)
## Contributing
Pistache is released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). Contributors are welcome!
Pistache 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!
The [Launchpad Team](https://launchpad.net/~pistache+team) administers the daily and stable Ubuntu pre-compiled packages.
### Versioning
The version of the library's public interface (ABI) is not the same as the release version, but we choose to always guarantee that the major release version and the soname version will match. 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.
GNU 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.
When Pistache is installed it will normally ship:
- `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.
- `libpistache.so.X`: 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.
- `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.
- `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.
If 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.
The 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.
## Precompiled Packages
If 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.
### Debian and Ubuntu
Pistache is available in the official repositories since Debian 12 and Ubuntu 23.10, under the package name `libpistache-dev`.
#### Supported Architectures
Currently 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.
- amd64
- arm64
- armhf
- i386
- ppc64el
- riscv64
- s390x
#### Ubuntu PPA (Unstable)
The project builds [daily unstable snapshots](https://launchpad.net/~pistache+team/+archive/ubuntu/unstable) in a separate unstable PPA. To use it, run the following:
```sh
$ sudo add-apt-repository ppa:pistache+team/unstable
$ sudo apt update
$ sudo apt install libpistache-dev
```
#### Ubuntu PPA (Stable)
Currently there are no stable release of Pistache published into the [stable](https://launchpad.net/~pistache+team/+archive/ubuntu/stable) PPA. However, when that time comes, run the following to install a stable package:
```sh
$ sudo add-apt-repository ppa:pistache+team/stable
$ sudo apt update
$ sudo apt install libpistache-dev
```
### Other Distributions
Package maintainers, please insert instructions for users to install pre-compiled packages from your respective repositories here.
## Use via pkg-config
If 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.
### GNU Autotools
To [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`:
```makefile
# Pistache...
PKG_CHECK_MODULES(
[libpistache], [libpistache >= 0.0.2], [],
[AC_MSG_ERROR([libpistache >= 0.0.2 missing...])])
YOURPROJECT_CXXFLAGS="$YOURPROJECT_CXXFLAGS $libpistache_CFLAGS"
YOURPROJECT_LIBS="$YOURPROJECT_LIBS $libpistache_LIBS"
```
### Meson
To use with Meson, you just need to add `dependency('libpistache')` as a dependency for your executable.
```meson
project(
'MyPistacheProject',
'cpp',
meson_version: '>=0.55.0'
)
executable(
'MyPistacheExecutable',
sources: 'main.cpp',
dependencies: dependency('libpistache')
)
```
If 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:
```meson
dependency('libpistache', fallback: 'pistache')
```
If you're using a Meson version older than 0.55.0 you'll have to use the "older" syntax for `dependency()`:
```meson
dependency('libpistache', fallback: ['pistache', 'pistache_dep'])
```
Lastly, if you'd like to build the fallback as a static library you can specify it with the `default_options` keyword:
```meson
没有合适的资源?快使用搜索试试~ 我知道了~
A high-performance REST toolkit written in C++.zip
共206个文件
cc:59个
h:42个
license:23个
需积分: 5 0 下载量 120 浏览量
2024-01-01
15:44:11
上传
评论
收藏 526KB ZIP 举报
温馨提示
A high-performance REST toolkit written in C++
资源推荐
资源详情
资源评论
收起资源包目录
A high-performance REST toolkit written in C++.zip (206个子文件)
meson.build 5KB
meson.build 2KB
meson.build 2KB
meson.build 1KB
meson.build 961B
meson.build 477B
meson.build 436B
meson.build 362B
meson.build 280B
meson.build 256B
http.cc 41KB
http_server_test.cc 39KB
client.cc 33KB
headers_test.cc 28KB
http_header.cc 24KB
listener.cc 22KB
router.cc 22KB
reactor.cc 19KB
http_client_test.cc 17KB
transport.cc 17KB
description.cc 16KB
net.cc 15KB
router_test.cc 15KB
async_test.cc 14KB
https_server_test.cc 12KB
base64.cc 11KB
endpoint.cc 10KB
mime.cc 10KB
listener_test.cc 9KB
cookie.cc 9KB
streaming_test.cc 8KB
stream.cc 8KB
os.cc 8KB
net_test.cc 8KB
http_headers.cc 7KB
mime_test.cc 7KB
rest_server_test.cc 7KB
http_parsing_test.cc 7KB
threadname_test.cc 6KB
cookie_test.cc 5KB
http_server.cc 5KB
request_size_test.cc 5KB
http_defs.cc 5KB
rest_description.cc 5KB
stream_test.cc 5KB
rest_server.cc 5KB
peer.cc 4KB
cookie_test_3.cc 4KB
listener_tls_test.cc 3KB
rest_swagger_server_test.cc 3KB
timer_pool.cc 3KB
reactor_test.cc 3KB
cookie_test_2.cc 3KB
http_client.cc 2KB
view_test.cc 2KB
log_api_test.cc 2KB
custom_header.cc 1KB
string_logger_test.cc 1KB
endpoint_initialization_test.cc 1KB
http_server_shutdown.cc 1KB
helpers_test.cc 1KB
utils.cc 849B
hello_server.cc 808B
mailbox_test.cc 756B
string_logger.cc 746B
fd_utils.cc 729B
tcp.cc 640B
typeid_test.cc 618B
http_uri_test.cc 591B
.clang-format 4KB
.clang-format-ignore 123B
openssl.conf 367B
fuzz_parser.cpp 2KB
server_from_intermediate_with_chain.crt 2KB
server_from_intermediate.crt 1KB
rootCA.crt 1KB
client.crt 1KB
server.crt 1KB
server_protected.crt 1KB
intermediateCA.crt 1KB
custom.css 3KB
index.module.css 514B
HomepageFeatures.module.css 287B
.gitignore 558B
.gitignore 319B
httplib.h 243KB
date.h 229KB
async.h 53KB
http.h 25KB
http_header.h 19KB
router.h 18KB
description.h 16KB
mailbox.h 13KB
http_defs.h 12KB
stream.h 8KB
net.h 7KB
rapidjson.h 7KB
transport.h 7KB
endpoint.h 7KB
client.h 7KB
共 206 条
- 1
- 2
- 3
资源评论
暮苍梧~
- 粉丝: 41
- 资源: 258
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功