prevent client-side navigation to server routes - fixes #145

This commit is contained in:
Rich Harris
2018-02-28 14:23:19 -05:00
parent 9bebb56bd6
commit c36780fdc8
9 changed files with 36 additions and 15 deletions

View File

@@ -22,8 +22,11 @@ function generate_client(routes: Route[], src: string, dev: boolean, dev_port?:
// This file is generated by Sapper — do not edit it!
export const routes = [
${routes
.filter(route => route.type === 'page')
.map(route => {
if (route.type !== 'page') {
return `{ pattern: ${route.pattern}, ignore: true }`;
}
const file = posixify(`../../routes/${route.file}`);
if (route.id === '_4xx' || route.id === '_5xx') {