我在 GKE 中有一个集群,它正在运行,一切似乎都在运行。如果我转发端口,我可以看到容器正在工作。
我无法从 namecheap 设置我拥有的域。
这些是我遵循的步骤
ns-cloud-c1.googledomains.com.
ns-cloud-c2.googledomains.com.
ns-cloud-c3.googledomains.com.
ns-cloud-c3.googledomains.com.
Run Code Online (Sandbox Code Playgroud)
我使用这封信c
是因为集群位于一个c
区域中(我不确定这是否正确)
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
Run Code Online (Sandbox Code Playgroud)
和
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.46.0/deploy/static/provider/cloud/deploy.yaml
Run Code Online (Sandbox Code Playgroud)
issuer.yml
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: cert-manager
spec:
acme:
# The ACME server URL
server: https://acme-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: example@email.com
# Name of a secret used to store the ACME …
Run Code Online (Sandbox Code Playgroud) kubernetes google-kubernetes-engine kubernetes-ingress nginx-ingress gke-networking
我正在通过Udemy 课程学习打字稿。我做了一个使用谷歌地图的练习。
然后,当我使用时nvm
,我将节点版本更新为 16。当我更新节点时,我执行了将 typescript 安装到较新版本的命令
$ npm install -g typescript ts-node
$ npm install -g @types/node @types/google.maps
Run Code Online (Sandbox Code Playgroud)
我开始了一项新练习,我只需编写控制台日志
索引.ts
console.log('Hi there')
Run Code Online (Sandbox Code Playgroud)
那么我应该编译该文件
$ ts index.ts
Run Code Online (Sandbox Code Playgroud)
生成index.js
了,但我也听到了错误的声音
...
../../../../../../node_modules/@types/googlemaps/reference/polygon.d.ts:51:9 - error TS2717: Subsequent property declarations must have the same type. Property 'path' must be of type '(LatLngLiteral | LatLng)[] | MVCArray<any>', but here has type 'LatLng[] | MVCArray<LatLng> | LatLngLiteral[]'.
51 path?: MVCArray<LatLng> | LatLng[] | LatLngLiteral[];
~~~~
../../../../../../node_modules/@types/google.maps/index.d.ts:5066:5
5066 path?: google.maps.MVCArray<any>|null|
~~~~
'path' was …
Run Code Online (Sandbox Code Playgroud) 我正在尝试对服务器进行HTTP POST.
我必须发送的数据是一个json对象.
问题是$ http.post在角度覆盖带有选项的方法.
我可以做这个配置
.config(['$httpProvider', function ($httpProvider) {
//Reset headers to avoid OPTIONS request (aka preflight)
$httpProvider.defaults.headers.common = {};
$httpProvider.defaults.headers.post = {};
$httpProvider.defaults.headers.put = {};
$httpProvider.defaults.headers.patch = {};
}])
Run Code Online (Sandbox Code Playgroud)
并从选项更改为POST,但我无法将内容类型设置为"application/json",并且我收到"415不支持的媒体类型"
谢谢
我只想将所有信息记录在一个文件中。我正在使用 pm2“0.12.1”和“winston”:“0.8.3”。
这是我的温斯顿代码
var winston = require('winston');
var customLoggerLevels = {
levels: {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4
},
colors: {
trace: 'blue',
debug: 'green',
info: 'grey',
warn: 'yellow',
error: 'red'
}
};
var logger = new (winston.Logger)({
levels: customLoggerLevels.levels
});
Run Code Online (Sandbox Code Playgroud)
和我的生态系统.json 的一部分
"apps" : [
{
"name" : "myapp",
"script" : "server.js",
"instances" : "1",
"err_file" : "myapp.log",
"out_file" : "myapp.log",
"env": {
"NODE_ENV": "development",
"PORT": 4000
},
"env_production" : {
"NODE_ENV": "production",
"PORT": …
Run Code Online (Sandbox Code Playgroud) 我试图在Slick 3.1.0-M1中模拟多对多的关系
这是Slick文档的示例
// Definition of the SUPPLIERS table
class Suppliers(tag: Tag) extends Table[(Int, String, String, String, String, String)](tag, "SUPPLIERS") {
def id = column[Int]("SUP_ID", O.PrimaryKey) // This is the primary key column
def name = column[String]("SUP_NAME")
def street = column[String]("STREET")
def city = column[String]("CITY")
def state = column[String]("STATE")
def zip = column[String]("ZIP")
// Every table needs a * projection with the same type as the table's type parameter
def * = (id, name, street, city, state, zip)
}
val …
Run Code Online (Sandbox Code Playgroud) 我的技术堆栈是
我试图实现此功能来更新数据库中的行
def update(userId: Long, user: User) = {
(for {
_ <- EitherT(updateUser(userId, user))
user: User <- EitherT(findById(userId))
userProfile: userProfile <- EitherT(userProfileRepository.findById(user.userProfileId))
} yield (user, userProfile).map {
case (user: User, userProfile: UserProfile) =>
val response = new UserResponse(user, userProfile)
Right(response)
case error =>
val str = s"update failure: $error"
Left(str)
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用EitherT编译此代码时,我得到了
value withFilter不是cats.data.EitherT的成员
我有这个docker-compose.yml
文件,我在其中运行 mongo 容器
version: '3'
services:
appapi:
container_name: appapi
image: strapi/strapi:3.1.3
environment:
DATABASE_CLIENT: ${APPAPI_DATABASE_CLIENT}
DATABASE_HOST: ${APPAPI_DATABASE_HOST}
DATABASE_PORT: ${APPAPI_DATABASE_PORT}
DATABASE_NAME: ${APPAPI_DATABASE_NAME}
DATABASE_USERNAME: ${APPAPI_DATABASE_USERNAME}
DATABASE_PASSWORD: ${APPAPI_DATABASE_PASSWORD}
ports:
- 1337:1337
volumes:
- ./app:/srv/app
depends_on:
- appmongo
appmongo:
container_name: appmongo
image: mongo:4.4.0
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${APPDB_MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${APPDB_MONGO_INITDB_ROOT_PASSWORD}
ports:
- "27027:27017"
volumes:
- ./data/db:/data/db
Run Code Online (Sandbox Code Playgroud)
我想备份运行转储的数据库
docker run -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin --rm mongo mongodump --host mongoapp:27027 --archive --gzip | cat > ./mongodumps/dump_$(date '+%d-%m-%Y_%H-%M-%S').gz
Run Code Online (Sandbox Code Playgroud)
我尝试修改前面的命令,但无法连接并进行转储,我得到
2020-08-15T19:27:04.870 + 0000失败:无法创建会话:无法连接到服务器:服务器选择错误:服务器选择超时,当前拓扑:{类型:单,服务器:[{地址:mongoapp:27027 ,类型:未知,状态:已连接,平均 RTT:0,最后一个错误:connection() :拨打 tcp:在 …
我正在尝试通过 Prisma 查询数据库(Postgres)。我的查询是
const products = await prisma.products.findMany({
where: { category: ProductsCategoryEnum[category] },
include: {
vehicles: {
include: {
manufacturers: { name: { in: { manufacturers.map(item => `"${item}"`) } } },
},
},
},
});
Run Code Online (Sandbox Code Playgroud)
错误信息是
输入 '{ name: { in: { 制造商: string; ““: 任何; }; }; }' 不可分配给类型 'boolean | 制造商Args'。对象文字只能指定已知属性,并且“manufacturersArgs”类型中不存在“name”。ts(2322)
厂家有领域name
,有独特性;我不确定为什么这不起作用或者如何更新此代码以便能够查询数据库。这就像我应该将这些值转换为 Prisma 参数。
scala ×2
angular-http ×1
angularjs ×1
atom-editor ×1
docker ×1
google-maps ×1
kubernetes ×1
mongodb ×1
node.js ×1
npm ×1
pm2 ×1
prisma ×1
prisma2 ×1
scala-cats ×1
slick ×1
typescript ×1
winston ×1