Skip to content

Commit ae6674a

Browse files
authored
Merge pull request #550 from reactioncommerce/feature_redirect_graphiql
Add 302 redirects to env.EXTERNAL_GRAPHQL_URL
2 parents 4acdc76 + 776b295 commit ae6674a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ app
4040

4141
configureAuthForServer(server);
4242

43+
// add graphiql redirects to EXTERNAL_GRAPHQL_URL
44+
server.get(["/graphiql", "/graphql-beta", "/graphql-alpha", "/graphql"], (req, res) => {
45+
res.redirect(301, config.EXTERNAL_GRAPHQL_URL);
46+
});
47+
4348
// apply to routes starting with "/sitemap" and ending with ".xml"
4449
server.use(/^\/sitemap.*\.xml$/, sitemapRoutesHandler);
4550

0 commit comments

Comments
 (0)