liveserver

simple live web server for local developments
git clone https://noulin.net/git/liveserver.git
Log | Files | Refs | README | LICENSE

commit 641515d23721b6227559b6e14d39f72724361192
parent 034ddf96bb82a3469151206689a4c33bf1a23756
Author: Remy Noulin <loader2x@gmail.com>
Date:   Mon, 17 Jun 2019 07:52:59 +0200

flush stdout before forking, adjust mime types

liveserver.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Diffstat:
Mliveserver.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/liveserver.c b/liveserver.c @@ -24,7 +24,7 @@ #include "libsheepyObject.h" #include "utilities.h" -#define BUFSIZE 8096 +#define BUFSIZE 8092 #define ERROR 42 #define SORRY 43 #define LOG 44 @@ -74,6 +74,7 @@ struct { {"jpg", "image/jpeg"}, {"jpeg","image/jpeg"}, {"png", "image/png" }, + {"ico", "image/png" }, {"zip", "image/zip" }, {"gz", "image/gz" }, {"tar", "image/tar" }, @@ -84,8 +85,9 @@ struct { {"asp", "text/asp" }, {"jsp", "image/jsp" }, {"xml", "text/xml" }, - {"js", "text/js" }, + {"js", "application/javascript" }, {"css", "text/css" }, + {"csv", "text/csv" }, {"//ws", "websocket"}, {0,0} }; @@ -407,6 +409,7 @@ int main(int argc, char **argv) execO("find . -type d", dirList, NULL); printf(GRN "http://0.0.0.0:%s/" RST "\nlog: server.log", portS); + fflush(stdout); if(fork() != 0) return 0;