FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

expresscpp/expresscpp at 528a37345cb35342a7155dafdb3d055f8e477a3d · GitHub

Repository files navigation

ExpressCpp

Fast, unopinionated, minimalist web framework for C++ Perfect for building REST APIs

status

Design goals

ExpressCpp aims to be for C++ the same as express for Node.JS including its ecosystem of middlewares and extensions.

Express and Node.JS:

const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(port, () => console.log(`Example app listening on port ${port}!`))

ExpressCpp:

auto expresscpp = std::make_shared<ExpressCpp>();
expresscpp->Get("/", [](auto req, auto res) { res->Send("hello world!") });
const uint16_t port = 3000u;
expresscpp.Listen(port, [](){
    std::cout << "Example app listening on port "<< port << std::endl;
}).Block();

Official Middlewares

  • expresscpp-logger -> TODO
  • expresscpp-static-files -> TODO
  • expresscpp-grpc-proxy -> TODO
  • expresscpp-reverse-proxy -> TODO
  • expresscpp-basic-auth -> TODO

Using me

TODO: finish this

add this to you conan file:

expresscpp/0.1.0@conan/stable

this to your cmake:

find_package(expresscpp)
# ...
target_link_libraries(my_target PRIVATE expresscpp)

Build instructions (e.g. ubuntu)

Dependencies

  • boost/beast
  • boost/asio
  • nlohmann/json
  • gtest (optional)
  • openSSL (optional)
sudo apt install -y cmake gcc-9 g++-9 python3-pip

# we use conan for dependency management
sudo pip3 install conan --upgrade
conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
conan remote add neargye "https://api.bintray.com/conan/neargye/conan-packages"

# we use gcovr for coverage reports
sudo pip3 install gcovr --upgrade

mkdir -p build
cd build
cmake ..
make -j

Similiar projects

BeastHttp https://github.com/0xdead4ead/BeastHttp/
crow https://github.com/ipkn/crow unmaintained
Simple-Web-Server https://gitlab.com/eidheim/Simple-Web-Server
restinio https://github.com/stiffstream/restinio
served https://github.com/meltwater/served

About

Fast, unopinionated, minimalist web framework for C++ Perfect for building REST APIs

Topics

Resources

Stars

96 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL