config: Make 'templatepath' optional, use embedded resources by default
This commit is contained in:
@@ -43,6 +43,7 @@ SOFTWARE.
|
||||
#include "cliconsole.h"
|
||||
#include "cliserver.h"
|
||||
#include "version.h"
|
||||
#include "embedded.h"
|
||||
|
||||
void sigterm_handler([[maybe_unused]] int arg)
|
||||
{
|
||||
@@ -189,6 +190,8 @@ int main(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
utils::embedded_init_text_resources();
|
||||
|
||||
start_background_worker(*database.get(), config);
|
||||
|
||||
CLIServer cliServer{cliHandler};
|
||||
@@ -214,8 +217,12 @@ int main(int argc, char **argv)
|
||||
User::setAnon(anon.value());
|
||||
|
||||
MapCache<TemplatePage> mapCache;
|
||||
Template siteTemplate{config.templateprefix, config.templatepath, config.urls, config.configVarResolver,
|
||||
Template siteTemplate{config.templateprefix, config.urls, config.configVarResolver,
|
||||
mapCache};
|
||||
if(!config.templatepath.empty())
|
||||
{
|
||||
siteTemplate.setPath(config.templatepath);
|
||||
}
|
||||
UrlProvider urlProvider{config.urls};
|
||||
|
||||
auto cache = createCache(config.configVarResolver);
|
||||
|
||||
Reference in New Issue
Block a user