There is missing some kind of logic which will check all aliases in array and would prefer static one instead of dynamics pages.
const paths = {
homepage: "/route:homepage",
typeAmount: "/route:venue",
auth: "/route:auth",
};
// Used at server
const routes = [
{
id: paths.homepage,
template: "/",
aliases: {
cs: "/cs",
en: "/en"
}
},
{
id: paths.typeAmount,
template: "/[code]",
aliases: {
"cs": "/cs/:code",
"en": "/en/:code"
}
},
{
id: paths.auth,
template: "/auth",
aliases: {
"cs": "/cs/autorizace",
"en": "/en/authentication",
}
}
];
module.exports.paths = paths;
module.exports.routes = routes;
This will be processed just fine, without 404.
Routes:
const paths = {
homepage: "/route:homepage",
typeAmount: "/route:venue",
auth: "/route:auth",
};
// Used at server
const routes = [
{
id: paths.homepage,
template: "/",
aliases: {
cs: "/cs",
en: "/en"
}
},
{
id: paths.auth,
template: "/auth",
aliases: {
"cs": "/cs/autorizace",
"en": "/en/authentication",
}
},
{
id: paths.typeAmount,
template: "/[code]",
aliases: {
"cs": "/cs/:code",
"en": "/en/:code"
}
}
];
module.exports.paths = paths;
module.exports.routes = routes;