httpmodules: init module httpmodules
This commit is contained in:
parent
d54bc367f1
commit
caacad97dd
3 changed files with 16 additions and 4 deletions
9
Makefile
9
Makefile
|
@ -2,18 +2,19 @@ DC = ldc2
|
||||||
CFLAGS = -Jstatic -Oz
|
CFLAGS = -Jstatic -Oz
|
||||||
|
|
||||||
OBJS = httpd.o http.o mimetypes.o
|
OBJS = httpd.o http.o mimetypes.o
|
||||||
|
MODULEOBJS = $(shell ls httpmodules/*.d | sed 's/\.d$$/.o/')
|
||||||
|
|
||||||
all: httpd
|
all: httpd
|
||||||
|
|
||||||
httpd: ${OBJS}
|
httpd: ${MODULEOBJS} ${OBJS}
|
||||||
${DC} -of=httpd ${OBJS}
|
${DC} -of=httpd ${OBJS} ${MODULEOBJS}
|
||||||
|
|
||||||
.SUFFIXES: .d .o
|
.SUFFIXES: .d .o
|
||||||
.d.o:
|
.d.o:
|
||||||
${DC} ${CFLAGS} -c $<
|
${DC} ${CFLAGS} -od=$(dir $<) -c $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f httpd ${OBJS}
|
rm -f httpd ${OBJS} ${MODULEOBJS}
|
||||||
|
|
||||||
$(shell ${DC} -o- -makedeps ${OBJS})
|
$(shell ${DC} -o- -makedeps ${OBJS})
|
||||||
|
|
||||||
|
|
2
http.d
2
http.d
|
@ -31,3 +31,5 @@ struct HTTPResponse
|
||||||
string responseBody;
|
string responseBody;
|
||||||
string httpVersion = "HTTP/1.1";
|
string httpVersion = "HTTP/1.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alias HTTPModule = HTTPResponse delegate (HTTPRequest);
|
||||||
|
|
9
httpmodules/package.d
Normal file
9
httpmodules/package.d
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
/++
|
||||||
|
+ Reusable components of an HTTP daemon
|
||||||
|
+/
|
||||||
|
module httpmodules;
|
||||||
|
|
||||||
|
import http;
|
||||||
|
|
||||||
|
HTTPModule[] httpModules = [
|
||||||
|
];
|
Loading…
Add table
Add a link
Reference in a new issue