-
Notifications
You must be signed in to change notification settings - Fork 519
Prerender static index.html #171
Comments
Currently all the templates and samples do work by injecting prerendered content into a Razor view's output. I'm guessing you want one of these two alternatives:
If your requirement is (2), then that's something that others have requested too (see #182). We may implement something like that soon, or perhaps someone in the community will do so. If your requirement is (1), then that's pretty unusual and hasn't been requested by anyone else. It would certainly be possible to do it by writing some custom code to invoke the prerendering APIs on your dev machines (e.g., from a command-line tool) and writing the output to disk. We don't have any plans to bake such a feature into the templates because it would be a very unusual use case and nobody else has asked for it. But I'm sure you could figure out a way if it's important to your project. |
BTW if I'm misinterpreting your requirement, please re-open and clarify what you're looking for that might be different from the two options I've mentioned above :) |
@SteveSandersonMS its more along the lines of number 2. We have static html files for our angular apps that we serve up with asp.net but not via razor. we would use ASP.net more for a backend web api and server site routing. so i would imagine you would have some sort of middle ware for the routes that would use prerender on the way out. For example we have 2 different angular apps. / maps to index.html for the root app and /MyAccount maps to /MyAccount/index.html I'm assuming prerender within node normally intercepts the output of each request, similar to filters or the new middleware in asp.net core? each app has various routes and pages but they are relative to the base url of the app |
Is it possible to use prerender on static .html files? eveything i have seen so far seems to trigger it from an ASP.net view.
We currently serve up several angular apps that are managed via bower. So they will be mapping asp.net mvc routes to specific index.html files.
i was thinking that there should be a way to do this through asp.net middle ware?
The text was updated successfully, but these errors were encountered: