Skip to content

Commit

Permalink
💫 added force option support for redirects #1
Browse files Browse the repository at this point in the history
  • Loading branch information
8eecf0d2 committed Oct 17, 2018
1 parent 4931664 commit 1dd0fc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ts/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class Server {
this.express.use(bodyParser.raw({ limit: "6mb" }));
this.express.use(bodyParser.text({ limit: "6mb", type: "*/*" }));
this.routeHeaders();
this.routeForcedRedirects();
this.routeStatic();
this.routeLambdas();
this.routeRedirects();
Expand Down Expand Up @@ -66,6 +67,18 @@ export class Server {
})
}

private routeForcedRedirects (): void {
if(!this.options.netlifyConfig.redirects) {
return
}

const forcedRedirects = this.options.netlifyConfig.redirects.filter(redirect => redirect.force === true);

for(const redirect of forcedRedirects) {
this.handleRedirect(redirect);
}
}

private routeRedirects (): void {
if(!this.options.netlifyConfig.redirects) {
return
Expand Down

0 comments on commit 1dd0fc3

Please sign in to comment.