Funny, and simple HTTP Server DSL written entirely in C
go-horse tries to make funnier to program in C, it has macros and helpers to make your code look like beauty.
after installed, edit the file main.c
use the macro GET
to map as many URL's you want, followed by the
code that returns a string to be returned
example:
#import "gohorse.h"
int main() {
GET("/.*",
render("<html><body><h1>Hello, you requested the url \"%s\"</h1></body></html>", request->url);
)
GO_HORSE();
return 0;
}
build with:
./autogen.sh
./configure
make
run with
./go-horse
ENJOY THE RIDE :)
- Install home brew
- Install dependencies through:
sudo brew install libmicrohttpd glib
./tests
#import "tdd.h"
i_think_it(should_be_my_test_name)
assert_equals("foo", "foo");
just_for_sure
yeah that is C with macros :)