Skip to content

Commit

Permalink
Merge pull request #550 from reactioncommerce/feature_redirect_graphiql
Browse files Browse the repository at this point in the history
Add 302 redirects to env.EXTERNAL_GRAPHQL_URL
  • Loading branch information
focusaurus authored Jul 3, 2019
2 parents 4acdc76 + 776b295 commit ae6674a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ app

configureAuthForServer(server);

// add graphiql redirects to EXTERNAL_GRAPHQL_URL
server.get(["/graphiql", "/graphql-beta", "/graphql-alpha", "/graphql"], (req, res) => {
res.redirect(301, config.EXTERNAL_GRAPHQL_URL);
});

// apply to routes starting with "/sitemap" and ending with ".xml"
server.use(/^\/sitemap.*\.xml$/, sitemapRoutesHandler);

Expand Down

0 comments on commit ae6674a

Please sign in to comment.