我目前正在使用 MongoDB 和 Express 创建一个新的 API,并且我目前遇到了这个问题“操作 disneys.insertOne() 缓冲在 10000 毫秒后超时”。我目前正在使用 route.rest 来测试我的 API。
但是,我不知道我目前做错了什么,有人可以看看我的Github 存储库吗?
这是我设置 API 调用的方式:
const express = require("express");
const router = express.Router();
const Disney = require("../models/disneyCharacter");
// Getting all character
router.get("/", async (req, res) => {
try {
const character = await Disney.find();
res.json(character);
} catch (err) {
res.status(500).json({ message: err.message });
}
});
// Getting one Character
router.get("/:id", getCharacter, (req, res) => {
res.json(res.character);
});
// Creating new Character
router.post("/", async (req, res) …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试遵循 CumulusCi 的指南,但在计算机内安装 pipx 时遇到一些问题。
我已经安装了 Python 3 并且当前正在运行以下命令:
pip install --user pipx
'''
The result is the following:
Run Code Online (Sandbox Code Playgroud)
已满足的要求:
pipx in c:\users\aharo\appdata\roaming\python\python39\site-packages (0.16.1.0)
Run Code Online (Sandbox Code Playgroud)
我设置了路径环境变量,当我运行 pipx list 时,它告诉我以下内容:
pipx : The term 'pipx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pipx list
+ ~~~~
+ CategoryInfo : …Run Code Online (Sandbox Code Playgroud) #node_modules/expo/AppEntry.js:[BABEL]
我已经为我的项目安装了所有依赖项,但我遇到了这个问题,但我不知道如何解决它。
#package.json - 主要
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"babel": "^6.23.0",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native-dotenv": "^2.4.2",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"babel-plugin-module-resolver": "^4.0.0"
},
"private": true,
"name": "my-project"
}
Run Code Online (Sandbox Code Playgroud)
我目前正在构建一个 ios 应用程序,似乎有以下问题
Referencing initializer 'init(_:content:)' on 'ForEach' requires that 'Planet' conform to 'Identifiable'
Run Code Online (Sandbox Code Playgroud)
这是我当前的代码:
//
// OnboadingView.swift
// Planets (iOS)
//
// Created by Andres Haro on 9/28/21.
//
import SwiftUI
struct OnboadingView: View {
// Porperties
var planets: [Planet] = planetsData
// Body
var body: some View {
TabView{
ForEach(planets[0...5]){ item in
PlanetCardView(planet: <#Planet#>)
} // Loop
} // Tab
.tabViewStyle(PageTabViewStyle())
.padding(.vertical, 20)
}
}
// Preview
struct OnboadingView_Previews: PreviewProvider {
static var previews: some View {
OnboadingView(planets: …Run Code Online (Sandbox Code Playgroud) 我目前正在做一些自动化工作,但我在克服格子 iframe 时遇到了困难。这是我的应用程序内部的样子:
\n\n我的应用程序内部的设置方式如下:
\n<div class="PaneActions PaneActions--no-padding-top"><button\n class="TextButton TextButton--is-action TextButton--is-threads-treatment TextButton--no-margin">\n <p class="FinePrint FinePrint--is-threads-treatment">By selecting \xe2\x80\x9cContinue\xe2\x80\x9d you agree to the <u>Plaid End User\n Privacy Policy</u></p>\n </button><button\n class="Touchable-module_resetButtonOrLink__hwe7O Touchable-module_block__WBbZm Touchable-module_wide__EYer3 Button-module_button__1yqRw Button-module_large__1nbMn Button-module_centered__3BGqS"\n id="aut-continue-button" type="button" role="button"><span class="Button-module_flex__2To5J"><span\n class="Button-module_text__38wV0">Continue</span></span></button></div>\nRun Code Online (Sandbox Code Playgroud)\n我正在获取父元素和子元素,我正在查看文本和许多其他选项,但我无法测试该产品。有人以前用过格子图案吗?
\n我的部署成功了
useLocation
/Users/hvaandres/Desktop/Development/Ecommerce/modules/hooks.js:29
26 | );
27 | }
28 |
> 29 | return useContext(Context).location;
30 | }
31 |
32 | export function useParams() {
Run Code Online (Sandbox Code Playgroud)
成功:
Compiled successfully!
You can now view ecommerce-store in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.1.194:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
Run Code Online (Sandbox Code Playgroud)
该问题表明该问题来自 hook.js 文件,但我在存储库中没有看到该文件:
如果我查看 chrome 工具,这是我的问题的参考
import React from "react";
import invariant from "tiny-invariant";
import Context from "./RouterContext.js";
import …Run Code Online (Sandbox Code Playgroud) 我运行此命令来创建我的 Pod:
kubectl run my-ngnix --image nginx
Run Code Online (Sandbox Code Playgroud)
现在,我尝试使用以下命令删除 pod/部署:
kubectl delete deployment my-nginx
Run Code Online (Sandbox Code Playgroud)
问题是我的终端告诉我这是不可能的。因为找不到正确的信息。
Error from server (NotFound): deployments.apps "my-nginx" not found
Run Code Online (Sandbox Code Playgroud)
如果要求全部,这就是我所看到的:
kubectl get all
NAME READY STATUS RESTARTS AGE
pod/my-ngnix 1/1 Running 0 27m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 159m
root@aharo003:~# kubectl stop pods,services -l pod/m-ngnix
Run Code Online (Sandbox Code Playgroud)
有人知道我还应该做什么吗?
目前,我在使用以下命令登录私有 AKS 群集时遇到一些问题:
az account set --subscription [subscription_id]
Run Code Online (Sandbox Code Playgroud)
az aks get-credentials --resource-group [resource-group] --name [AKS_cluster_name]
Run Code Online (Sandbox Code Playgroud)
输入这两个命令后,它要求我使用 AZ CLI 生成的代码通过 Web 进行身份验证,之后,我在终端上遇到以下问题:
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code RTEEREDTE to authenticate.
Unable to connect to the server: dial tcp: lookup aksdusw2aks01-0581cf8f.hcp.westus2.azmk8s.io: i/o timeout
Run Code Online (Sandbox Code Playgroud)
潜在的问题可能是什么?如何成功登录私有 AKS 集群?
笔记:
我还有一些其他集群,我可以通过终端登录它们,而不会出现任何类型或种类的错误。
command-line-interface azure kubernetes kubernetes-helm azure-aks
javascript ×4
testing ×3
automation ×2
azure ×2
kubernetes ×2
node.js ×2
reactjs ×2
api ×1
azure-aks ×1
azure-devops ×1
cypress ×1
dependencies ×1
e-commerce ×1
expo ×1
express ×1
ios ×1
kubectl ×1
list ×1
mongodb ×1
performance ×1
pip ×1
python ×1
react-native ×1
swift ×1
swiftui ×1
terminal ×1