Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/hub/manifest.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45// dynamically generate the manifest json file – for html5 web app's67import { Response } from "express";8import { join } from "path";9import { SiteSettingsKeys } from "@cocalc/util/db-schema/site-defaults";10import base_path from "@cocalc/backend/base-path";1112interface Custom {13configuration: Record<SiteSettingsKeys, string>;14}1516export function send(res: Response, custom: Custom) {17const config = custom.configuration;1819// See https://developer.mozilla.org/en-US/docs/Web/Manifest, which says20// "the response of the manifest file should return Content-Type: application/manifest+json)"21res.header("Content-Type", "application/manifest+json");2223const base_app = join(base_path, "app");2425const manifest = {26name: config.site_name,27short_name: config.site_name,28start_url: `${base_app}?utm_medium=manifest`,29scope: base_path,30display: "minimal-ui",31background_color: "#fbb635",32theme_color: "#4474c0",33description: config.site_description,34icons: [35{36src:37config.logo_square ??38"https://storage.googleapis.com/cocalc-extra/cocalc-icon-white-fillin.256px.png",39sizes: "256x256",40type: "image/png",41},42],43};4445res.send(JSON.stringify(manifest, null, 2));46}474849