Dynamic HTML generation - PLLUG/CPPQT-2019-1-FileServer GitHub Wiki
User interface
Server starting page will consist of an image, server name, and parent directory. In our parent directory, there will be more folders and/or files to download. Also in every folder, we will be able to go back in the parent directory(the same in info. page) Every file will have its size and information page.
In information page, there will be info about the creation of the file, last modification of the file, its size, hash(sha1), md5. Also in the info page, we will be able to download file too.
To get styles, colors, fonts we will use CSS. If you are interested in more information, you can see file-server directories and information page mockups:
1)directories - TBD 2)Information page - TDB
Using {{mustache}} templates for HTML code generation
When the client gets access to the server from its own computer, our program will generate HTML code. To do this we will use {{mustache}} templates. So because of this, we will be able to start our program from different computers.
About {{mustache}}:
Mustache can be used for HTML(in our case), config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. {{mustache}} has no if statements, else clauses, or for loops. To replace this we have tags. Some tags are replaced with a value, some nothing, and others a series of values.
Docs: https://mustache.github.io/mustache.5.html
mustashe homepage: https://mustache.github.io/
kainjow/Mustache C++ implemetation: https://github.com/kainjow/Mustache