telize

High performance JSON IP and GeoIP REST API (IP Geolocation)
Log | Files | Refs | README | LICENSE

commit 7372de106f5797e2289706c585763998f0f62308
parent 0cd2e49529a063de6b09de80706e4251b3afd404
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu,  4 Oct 2018 22:32:17 +0200

Initial C version with Kore: application skeleton generated by kodev

Diffstat:
Aconf/build.conf | 34++++++++++++++++++++++++++++++++++
Aconf/telize.conf | 13+++++++++++++
Asrc/telize.c | 11+++++++++++
3 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/conf/build.conf b/conf/build.conf @@ -0,0 +1,34 @@ +# telize build config +# You can switch flavors using: kodev flavor [newflavor] + +# Set to yes if you wish to produce a single binary instead +# of a dynamic library. If you set this to yes you must also +# set kore_source together with kore_flavor. +#single_binary=no +#kore_source=/home/joris/src/kore +#kore_flavor= + +# The flags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +cxxflags=-Wall -Wmissing-declarations -Wshadow +cxxflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +# Mime types for assets served via the builtin asset_serve_* +#mime_add=txt:text/plain; charset=utf-8 +#mime_add=png:image/png +#mime_add=html:text/html; charset=utf-8 + +dev { + # These flags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g + cxxflags=-g +} + +#prod { +# You can specify additional flags here which are only +# included if you build with the "prod" flavor. +#} diff --git a/conf/telize.conf b/conf/telize.conf @@ -0,0 +1,13 @@ +# telize configuration + +bind 127.0.0.1 8888 +load ./telize.so + +tls_dhparam dh2048.pem + +domain * { + certfile cert/server.pem + certkey cert/key.pem + + static / page +} diff --git a/src/telize.c b/src/telize.c @@ -0,0 +1,11 @@ +#include <kore/kore.h> +#include <kore/http.h> + +int page(struct http_request *); + +int +page(struct http_request *req) +{ + http_response(req, 200, NULL, 0); + return (KORE_RESULT_OK); +}