小编int*_*tex的帖子

标题和元标记未在服务器的角度SSR中呈现

我已经在前端使用Angular 6开发了一个网站。默认情况下,Angular不是SEO友好的,因此,为了做到这一点,我以Angular-Universal或Angular SSR(服务器端渲染)的方式实现了它。我更新了代码并比较了以前和现在的页面源,我可以在标记<app-root>和中看到我的应用程序</app-root>,然后才出现“正在加载...”。

我现在用的是MetaServiceTitleService@angular/platform-browser更新所需<meta>的Facebook和Twitter和标签<title>分别标记。

问题是当我在本地系统中运行节点服务器时,view-source向我显示了渲染的meta标签,但是当我在AWS VM上的节点服务器中运行相同的代码时,我没有得到渲染的meta标签,但获得了其他应用程序代码可用。

更新: 添加meta标签的功能

updateMetaTags(egElement: Elements[]) {
    this.url = 'https://example.com/eg/' + this.id;
    const title = egElement[1].innerHTML;
    this.tweetText = 'Check the latest blog on \"' + title + '\"';
    this.meta.addTags([
      { property: 'og:url', content: this.url },
      { property: 'og:type', content: 'website' },
      { property: 'og:title', content: title },
      { property: 'og:description', content: 'Author: ' + egElement[2].innerHTML }, …
Run Code Online (Sandbox Code Playgroud)

meta angular-seo angular-universal ssr angular

5
推荐指数
1
解决办法
1849
查看次数

用于在Telegram上部署的Bot Framework中的新行

方法1:

public async Task WelcomeAsync(
        IDialogContext context,
        IAwaitable<Message> argument)
{
    var message = await argument;
    message.SetBotConversationData("DateTime", DateTime.UtcNow);

    StorageAccess.StoreTemporaryLog(
    StorageAccess.GetDateTime(message.GetBotConversationData<DateTime>("DateTime")),
        "user",
        message.Text);

    await context.PostAsync(
        "Welcome to VAM Insurance Bot\n" +
        "Do you already have a policy or do you want to buy a new policy?\n" +
        "1.Already\n" +
        "2.New\n" +
        "Please enter the correct choice:");

    StorageAccess.StoreTemporaryLog(
        StorageAccess.GetDateTime(message.GetBotConversationData<DateTime>("DateTime")),
        "bot",
        "Welcome to VAM Insurance Bot\n" +
        "Do you already have a policy or do you want to buy a new policy?\n" +
        "1.Already\n" …
Run Code Online (Sandbox Code Playgroud)

c# botframework

4
推荐指数
1
解决办法
3139
查看次数

我可以使用Entity Framework 6(非实体框架核心)开发Asp.net核心MVC应用程序吗?

我想ASP.NET Core用我的新项目,因为我听说它更快.但是,该项目将使用广泛的数据库访问功能,其中一些不受支持Entity Framework Core.我想知道,是否可以ASP.NET Core MVC使用Entity Framework 6(不Entity Framework Core)开发应用程序?

asp.net-mvc entity-framework asp.net-core-mvc .net-core asp.net-core

2
推荐指数
1
解决办法
163
查看次数