Browse Source

Initial commit, add skeleton project for kore

Helmut Pozimski 5 years ago
commit
1a31942b07
5 changed files with 66 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 6 0
      jsonrtc/.gitignore
  3. 35 0
      jsonrtc/conf/build.conf
  4. 13 0
      jsonrtc/conf/jsonrtc.conf
  5. 11 0
      jsonrtc/src/jsonrtc.c

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+*.pem

+ 6 - 0
jsonrtc/.gitignore

@@ -0,0 +1,6 @@
+*.o
+.flavor
+.objs
+jsonrtc.so
+assets.h
+cert

+ 35 - 0
jsonrtc/conf/build.conf

@@ -0,0 +1,35 @@
+# jsonrtc 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
+
+ldflags=-lcjson
+# 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.
+#}

+ 13 - 0
jsonrtc/conf/jsonrtc.conf

@@ -0,0 +1,13 @@
+# jsonrtc configuration
+
+bind		127.0.0.1 8888
+load		./jsonrtc.so
+
+tls_dhparam	dh2048.pem
+
+domain * {
+	certfile	cert/server.pem
+	certkey		cert/key.pem
+
+	static	/	page
+}

+ 11 - 0
jsonrtc/src/jsonrtc.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);
+}