小编Dwa*_*ove的帖子

Kubernetes:从 Angular 访问后端 API

我有一个包含 Web API 和 Angular 前端 (NGINX) 的项目。它们使用 Kubernetes 托管在 Google 的容器引擎上。当我尝试使用 Web API 服务访问时http://${service_name}/api出现net::ERR_NAME_NOT_RESOLVED错误。

但是,如果我通过 ssh 进入 Angular pod 并卷曲相同的地址,我会得到响应。如何在不公开公共 IP 的情况下访问后端 API(从使用 Angular 的浏览器)?

nginx kubernetes google-kubernetes-engine angular

5
推荐指数
0
解决办法
1269
查看次数

错误 - 客户端/服务器不匹配:React、Redux、NextJS、Typescript 和样式化组件

我一直在尝试将 Next.js 用于 SSR、Typescript 和样式化组件的 Counter 示例。我在 Github 上有一个主要工作的例子:https : //github.com/dwaynelavon/nextscript-boilerplate

问题是我不断收到有关客户端/服务器不匹配的错误。Warning: Text content did not match. Server: "1" Client: "0". 我无法弄清楚是什么问题。有什么建议?

// Index.tsx

type CounterDispatchProps = {
  addCount: () => any;
  startClock: () => any;
};

type CounterStateProps = {
  lastUpdate: number;
  light: boolean;
};

class Counter extends React.Component<
  CounterDispatchProps & CounterStateProps
> {
  private timer: number;
  constructor(props: CounterDispatchProps & CounterStateProps) {
    super(props);
  }
  static getInitialProps(props: any) {
    const store = props['store'];
    const isServer = props['isServer']; …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs redux styled-components nextjs

5
推荐指数
0
解决办法
1373
查看次数