feature(user-menu) rm path

This commit is contained in:
coderaiser 2019-08-21 14:53:50 +03:00
parent 98e284074c
commit 57984fe2d6

View file

@ -72,23 +72,27 @@ async function onGET({req, res, menuName}) {
if (parseError)
return res
.type('js')
.send(`const e = Error(\`<pre>path: ${menuPath}\n\n${codeframe({
error: parseError,
source,
highlightCode: false,
})}
</pre>\`);
e.code = 'frame';
throw e;
`);
.send(getError(parseError, source));
res
.type('js')
.send(result.code);
}
function getError(parseError, source) {
return `
const e = Error(\`<pre>${codeframe({
error: parseError,
source,
highlightCode: false,
})}</pre>\`);
e.code = 'frame';
throw e;
`;
}
function sendDefaultMenu(res) {
res.sendFile(DEFAULT_MENU_PATH, {
cacheControl: false,