Compare commits

..

2 commits

Author SHA1 Message Date
d89117430d Minor tweaks/fixes
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 32s
Add example config using "_FILE" variables.

Increase limit of config value size from 256 to 1024.
2024-09-06 12:49:32 +09:00
b12029984f Add more example.config stuff 2024-09-06 12:42:18 +09:00
4 changed files with 69 additions and 3 deletions

View file

@ -1,6 +1,38 @@
PATH=/ PATH=/
HTML='''Test HTML HTML='''
{{{Var}}} <html>
<head>
<style>
body {
color: #FFF;
background-color: #333;
}
a {
color: #AAF;
}
a:link {
color: #AAF;
}
a:visited {
color: #88B;
}
a:focus a:hover {
color: #DDF;
}
a:active {
color: #FFF;
}
</style>
</head>
<body>
<h1>Test HTML</h1><br>
<h2>{{{Var}}}</h2>
<h3><a href="/inner">To inner.</a></h3>
</body>
''' '''
Var='''Test var value''' Var='''Test var value'''
PATH=/inner
HTML_FILE='''example_config/inner.html'''
VAR_FILE='''example_config/var.html'''

33
example_config/inner.html Normal file
View file

@ -0,0 +1,33 @@
<html>
<head>
<style>
body {
color: #FFF;
background-color: #333;
}
a {
color: #AAF;
}
a:link {
color: #AAF;
}
a:visited {
color: #88B;
}
a:focus a:hover {
color: #DDF;
}
a:active {
color: #FFF;
}
</style>
</head>
<body>
<h1>Inner</h1>
{{{VAR_FILE}}}
<br>
<a href="..">Back.</a>
</body>
</html>

1
example_config/var.html Normal file
View file

@ -0,0 +1 @@
<h2>Some other text.</h2>

View file

@ -19,7 +19,7 @@
#define C_SIMPLE_HTTP_SLEEP_NANOS 1000000 #define C_SIMPLE_HTTP_SLEEP_NANOS 1000000
#define C_SIMPLE_HTTP_RECV_BUF_SIZE 1024 #define C_SIMPLE_HTTP_RECV_BUF_SIZE 1024
#define C_SIMPLE_HTTP_CONFIG_BUF_SIZE 256 #define C_SIMPLE_HTTP_CONFIG_BUF_SIZE 1024
#define C_SIMPLE_HTTP_QUOTE_COUNT_MAX 3 #define C_SIMPLE_HTTP_QUOTE_COUNT_MAX 3
#endif #endif