ProductPromotion
Logo

C++ Programming

made by https://0x3d.site

GitHub - wfrest/wfrest: C++ Web Framework REST API
C++ Web Framework REST API. Contribute to wfrest/wfrest development by creating an account on GitHub.
Visit Site

GitHub - wfrest/wfrest: C++ Web Framework REST API

GitHub - wfrest/wfrest: C++ Web Framework REST API

中文版入口

✨ wfrest: C++ Web Framework REST API

Fast🚀, efficient⌛️, and easiest💥 c++ async micro web framework based on C++ Workflow.

C++ Workflow is a light-weighted C++ Parallel Computing and Asynchronous Networking Engine.

If you need performance and good productivity, you will love ✨wfrest✨.

Contents

Dicssussion

For more information, you can first see discussions:

https://github.com/wfrest/wfrest/discussions

Build

Requirement

  • workflow, version v0.9.9 or newer
  • Linux , like ubuntu 16.04 or newer
  • Cmake or Xmake
  • zlib1g-dev
  • libssl-dev
  • libgtest-dev
  • gcc and g++ or llvm + clang, tested with ubuntu 20.04

Tips : Because in g++ 4.9 and the previous version, lambda can't capture variadic templates, we require you to upgrade your g++ version to 5.0 and above.

If you are on ubuntu 20.04, you may install them by command:

apt-get install build-essential cmake zlib1g-dev libssl-dev libgtest-dev -y

For more details, you can see here : requirement details

Cmake

git clone --recursive https://github.com/wfrest/wfrest
cd wfrest
make
sudo make install

For test :

make check

For example :

make example

Xmake

If you want to use xmake to build wfrest, you can see xmake build document

Docker

Use dockerfile, the Dockerfile locate /docker subdirectory of root source code repository.

docker build -t wfrest ./docker/ubuntu/

If you are using podman, you can also build it. and tested under ubuntu 20.04

podman build -t wfrest ./docker/ubuntu/

Or you can Pull from DockerHub

docker pull wfrest/wfrest

Quick start

#include "wfrest/HttpServer.h"
using namespace wfrest;

int main()
{
    HttpServer svr;

    // curl -v http://ip:port/hello
    svr.GET("/hello", [](const HttpReq *req, HttpResp *resp)
    {
        resp->String("world\n");
    });
    // curl -v http://ip:port/data
    svr.GET("/data", [](const HttpReq *req, HttpResp *resp)
    {
        std::string str = "Hello world";
        resp->String(std::move(str));
    });

    // curl -v http://ip:port/post -d 'post hello world'
    svr.POST("/post", [](const HttpReq *req, HttpResp *resp)
    {
        // reference, no copy here
        std::string& body = req->body();
        fprintf(stderr, "post data : %s\n", body.c_str());
    });

    if (svr.start(8888) == 0)
    {
        getchar();
        svr.stop();
    } else
    {
        fprintf(stderr, "Cannot start server");
        exit(1);
    }
    return 0;
}

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory