httpmodules: init module httpmodules

This commit is contained in:
Jeremy Baxter 2024-08-07 13:25:58 +12:00
parent d54bc367f1
commit caacad97dd
3 changed files with 16 additions and 4 deletions

View file

@ -2,18 +2,19 @@ DC = ldc2
CFLAGS = -Jstatic -Oz
OBJS = httpd.o http.o mimetypes.o
MODULEOBJS = $(shell ls httpmodules/*.d | sed 's/\.d$$/.o/')
all: httpd
httpd: ${OBJS}
${DC} -of=httpd ${OBJS}
httpd: ${MODULEOBJS} ${OBJS}
${DC} -of=httpd ${OBJS} ${MODULEOBJS}
.SUFFIXES: .d .o
.d.o:
${DC} ${CFLAGS} -c $<
${DC} ${CFLAGS} -od=$(dir $<) -c $<
clean:
rm -f httpd ${OBJS}
rm -f httpd ${OBJS} ${MODULEOBJS}
$(shell ${DC} -o- -makedeps ${OBJS})

2
http.d
View file

@ -31,3 +31,5 @@ struct HTTPResponse
string responseBody;
string httpVersion = "HTTP/1.1";
}
alias HTTPModule = HTTPResponse delegate (HTTPRequest);

9
httpmodules/package.d Normal file
View file

@ -0,0 +1,9 @@
/++
+ Reusable components of an HTTP daemon
+/
module httpmodules;
import http;
HTTPModule[] httpModules = [
];