我有一个包含 Web API 和 Angular 前端 (NGINX) 的项目。它们使用 Kubernetes 托管在 Google 的容器引擎上。当我尝试使用 Web API 服务访问时http://${service_name}/api
出现net::ERR_NAME_NOT_RESOLVED
错误。
但是,如果我通过 ssh 进入 Angular pod 并卷曲相同的地址,我会得到响应。如何在不公开公共 IP 的情况下访问后端 API(从使用 Angular 的浏览器)?
我一直在尝试将 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)