/*
* Copyright (C) 2024 Puter Technologies Inc.
*
* This file is part of Puter.
*
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
const {encode} = require('html-entities');
const path_ = require('path');
const fs_ = require('fs');
const generate_puter_page_html = ({
env,
manifest,
gui_path,
use_bundled_gui,
app_origin,
api_origin,
meta,
gui_params,
}) => {
const e = encode;
const {
title,
description,
short_description,
company,
canonical_url,
} = meta;
gui_params = {
...meta,
...gui_params,
app_origin,
api_origin,
gui_origin: app_origin,
};
const asset_dir = env === 'dev'
? '/src' : '/dist' ;
// const asset_dir = '/dist';
const bundled = env != 'dev' || use_bundled_gui;
return `