I'm using react-helmet to give each of my pages a unique title and description for my React application. The title is rendering correctly in the browser tab and the title and description are rendering correctly when I inspect the page using Dev Tools. However, Google isn't showing either the title or description in their search results. What am I doing wrong?
I've looked into using prerender.io but as my site doesn't have a backend (it's just a marketing site for …
我有一个 NestJs 应用程序,它使用 HttpOnly cookie 进行身份验证。在开发过程中一切都很完美。我的 NextJs 客户端 (http://localhost:4200) 使用 Graphql 向我的 NestJs 服务器 (http://localhost:3333) 发送登录请求,该服务器在响应中设置 httpOnly cookie,然后客户端成功将 cookie 添加到浏览器存储。
但是,当我将这两个应用程序部署到 Render.com 时,除了最后一步之外,一切都正常。响应中已成功接收 cookie,但未将其添加到浏览器存储中。有趣的是,如果我使用已部署生产服务器的 GraphQL 游乐场来发出登录请求,则一切正常。因此,显然,问题似乎是请求来自子域。
我的生产配置:
客户端:https://swingapple-web-staging.onrender.com
服务器: https: //swingapple-api-staging.onrender.com
Cookie 设置(服务器):
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax',
secure: process.env.NODE_ENV === 'production',
domain: process.env.NODE_ENV === 'production' ? '.onrender.com' : undefined
Run Code Online (Sandbox Code Playgroud)
Nestjs的GraphQLModule设置(服务器):
playground: true,
introspection: true,
autoSchemaFile: true,
sortSchema: true,
context: ({ req, res }) => ({ req, res }),
cors: {
credentials: true,
origin: [process.env.CLIENT_URL, 'http://localhost:4200'] …Run Code Online (Sandbox Code Playgroud) cookies ×1
cross-domain ×1
httponly ×1
meta-tags ×1
metadata ×1
nestjs ×1
react-helmet ×1
reactjs ×1
samesite ×1
seo ×1