mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Update to latest Angular2/angular-universal and use relative URLs in template's HTTP request
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aspnet-prerendering",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Helpers for server-side rendering of JavaScript applications in ASP.NET projects. Works in conjunction with the Microsoft.AspNet.SpaServices NuGet package.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -19,9 +19,10 @@ export interface BootFunc {
|
||||
}
|
||||
|
||||
export interface BootFuncParams {
|
||||
location: url.Url;
|
||||
url: string;
|
||||
absoluteUrl: string;
|
||||
location: url.Url; // e.g., Location object containing information '/some/path'
|
||||
origin: string; // e.g., 'https://example.com:1234'
|
||||
url: string; // e.g., '/some/path'
|
||||
absoluteUrl: string; // e.g., 'https://example.com:1234/some/path'
|
||||
domainTasks: Promise<any>;
|
||||
}
|
||||
|
||||
@@ -44,8 +45,10 @@ export function renderToString(callback: RenderToStringCallback, applicationBase
|
||||
const domainTaskCompletionPromise = new Promise((resolve, reject) => {
|
||||
domainTaskCompletionPromiseResolve = resolve;
|
||||
});
|
||||
const parsedAbsoluteRequestUrl = url.parse(absoluteRequestUrl);
|
||||
const params: BootFuncParams = {
|
||||
location: url.parse(requestPathAndQuery),
|
||||
origin: parsedAbsoluteRequestUrl.protocol + '//' + parsedAbsoluteRequestUrl.host,
|
||||
url: requestPathAndQuery,
|
||||
absoluteUrl: absoluteRequestUrl,
|
||||
domainTasks: domainTaskCompletionPromise
|
||||
|
||||
Reference in New Issue
Block a user