I picked up G-WAN only a while back and I'm trying to figure out how to make the index use a specific servlet while also having static content available.
I moved index.html
to index_old.html
so I wouldn't have any conflicts.
I placed the following into a handler.
xbuf_t *read_xbuf = (xbuf_t*)get_env(argv, READ_XBUF);
xbuf_replfrto(read_xbuf, read_xbuf->ptr, read_xbuf->ptr + 16, "/", "/?hello");
After restarting gwan, I saw Hello, ANSI C!
just like I desired.
However, I noticed that all other contents no longer loaded, even the 404 page was different!
So, then I had a thought, that this seemed to be doing string substitution, rather than precise matching.
xbuf_t *read_xbuf = (xbuf_t*)get_env(argv, READ_XBUF);
xbuf_replfrto(read_xbuf, read_xbuf->ptr, read_xbuf->ptr + 16, "/", "/?");
Now, when hitting /
, I saw a 404, and /hello
, I saw the servlet again. So, this does not seem to be the solution I am looking for.
Again, I just want /
to hit a specific servlet of my designation, and for all other requests to not be effected by this one rule.
Thanks,