Skip to content

A very simple web server built for CloudABI, making use of Flower networking

License

Notifications You must be signed in to change notification settings

NuxiNL/cloudabi-demo-webserver

Repository files navigation

A simple web server demo for CloudABI

In this repository you can find a relatively simple web server written in C++. It is designed to run on CloudABI, making use of Flower for networking.

Building

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-x86_64-cloudabi.cmake ..
make

Running

flower_switchboard /tmp/switchboard &
cloudabi-run cloudabi-demo-webserver << EOF &
%TAG ! tag:nuxi.nl,2015:cloudabi/
---
http_switchboard: !flower_switchboard_handle
    switchboard_path: /tmp/switchboard
    constraints:
        rights: [SERVER_START]
        in_labels:
            prog: webserver
logger_output: !fd stdout
html_response: <marquee>It works!</marquee>
EOF
sudo flower_ingress_accept 0.0.0.0:80 /tmp/switchboard '{"prog": "webserver"}' &
curl http://localhost/