Reputation: 379
I want to use Azure CDN (which is powered by EdgeCast, apparently) to serve static content for my React + GraphQL web app.
The CDN will pull the static files from a Storage account, and Node.js will handle the GraphQL endpoint.
For the client-side routing to work properly, I need to serve /static/index.html
for all requests that don't match the static content path (/static/somefile.ext
).
I want to avoid using Node.js to serve the index.html
in this fashion:
var express = require('express');
var app = express();
app.all('*', function(req, res){
res.sendfile("index.html");
});
Upvotes: 2
Views: 1495
Reputation: 1240
You could try to use the "Modify Client Response Header" feature:
Upvotes: 0
Reputation: 501
If you are using a Verizon Premium SKU, you can access the rules engine by clicking 'Manage' from the azure portal.
I would use a rule like this to rewrite everything except your static link to index.html
Upvotes: 2