agraboso / redux-api-middleware

Redux middleware for calling an API.
MIT License
1.49k stars 202 forks source link

asp.net core serverside prerendering - fetch #156

Open virzak opened 6 years ago

virzak commented 6 years ago

Is there a way to configure our own fetch function?

This is needed to for server-side prerendering in ASP.NET core.

Particularly, ASP.NET Core needs to use a fetch that can takes a relative URL and self signed certificates

Here is an implementation of such fetch.

https://github.com/aspnet/JavaScriptServices/blob/dev/src/Microsoft.AspNetCore.SpaServices/npm/domain-task/src/fetch.ts

Thanks

nason commented 6 years ago

Hi @virzak -- great question. In the upcoming 2.0 release (see the next branch), the fetch polyfill is no longer provided and this middleware will use fetch from the global scope.

Would that work for your use case?

virzak commented 6 years ago

@nason Sounds like it would work, but needs to be tested. I would test it with ASP.NET Core reactredux template.

nason commented 6 years ago

Makes sense @virzak -- I have no experience with ASP.NET and wouldn't know where to begin :) Please let us know how it goes, if you do end up using this package in that environment.

2.0 was just released, so this should be ready to go.