Tinyserve is going to be a http(s) server implemented in C++ to host static files. Eventually, it may move to a more dynamic system, but currently will only support a single host.
The following options will supported at the start of this project, if more options are necessary for my purposes or others, they can be added later.
The configuration file will be a json object with the following structure:
{
"port" : <number>,
"maximum_queued" : <number>,
"maximum_threads" : <number>,
"host" : {
"static_folder" : <string>
"default_root" : <string>
},
"cache" : {
"size" : <number>,
"time" : <number>
},
"ssl" : {
"file" : "string"
}
}
each of the options will be explained below:
- port: the port that you want the server to listen on
- maxmimum_queued: the total number of queued requests you want before a send back occurs
- maximum_threads: maximum threads you want in the pool to service requests
- host: relates to all things defined for hosting a static site
- static_folder: the root folder of your static assets
- default_root: what file you want to show when your site is hit
- cache: relates to all things in caching your static site in memory
- size: the maximum number of items you want held in the cache
- time: the time to live that the items will stay in the cache before they are wiped from memory
- ssl: relates to all things to setup ssl for your static site
- file: the location of your certificate