mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 14:40:38 +00:00

* check in full site application * rm unused assets components * change base css * i18n * new doc workflow * fix crosslink to doc in github * nav, console link, assets, console brand * edit configjs server * rm go struct references * cleanup input output bindings * working dir * export path * always trigger * rel paths * cname * rev workdir * fix fallbacklanguage, home on large screens * remove mit from site
27 lines
861 B
JavaScript
27 lines
861 B
JavaScript
import send from '@polka/send';
|
|
import { locale } from 'svelte-i18n';
|
|
|
|
import { LANGUAGES } from '../../config.js';
|
|
import { INIT_OPTIONS } from '../i18n.js';
|
|
import generate_docs from '../utils/generate_docs.js';
|
|
|
|
let json;
|
|
|
|
export function get(req, res) {
|
|
if (!json || process.env.NODE_ENV !== 'production') {
|
|
const { slug } = req.params;
|
|
locale.subscribe(localecode => {
|
|
console.log('sublocale: ' + localecode, LANGUAGES);
|
|
if (!LANGUAGES.includes(localecode)) {
|
|
console.log(INIT_OPTIONS);
|
|
localecode = INIT_OPTIONS.initialLocale || 'en';
|
|
}
|
|
json = JSON.stringify(generate_docs('docs/', slug, localecode)); // TODO it errors if I send the non-stringified value
|
|
});
|
|
}
|
|
|
|
send(res, 200, json, {
|
|
'Content-Type': 'application/json'
|
|
});
|
|
}
|