将选项 { useNewUrlParser: true } 传递给 MongoClient.connect
pass option { useNewUrlParser: true } to MongoClient.connect
我想为 composer-rest-server 实施 passport-local 策略
COMPOSER_CARD=admin@stschain
COMPOSER_NAMESPACES=never
COMPOSER_AUTHENTICATION=true
COMPOSER_MULTIUSER=true
COMPOSER_PROVIDERS='{
"local": {
"provider": "local",
"module": "passport-local",
"usernameField": "username",
"passwordField": "password",
"authPath": "/auth/local",
"callbackURL":"/auth/local/callback",
"successRedirect": "/",
"failureRedirect": "/",
"setAccessToken": true,
"callbackHTTPMethod": "post"
},
}'
COMPOSER_DATASOURCES='{
"db": {
"name": "db",
"connector": "mongodb",
"host": "mongo"
}
}'
i 运行 此 CMD:docker run -d --name mongo --network
composer_default -p 27017:27017 mongo
用于启动 MongoDB docker 容器,并执行实施此策略所需的所有操作,但是当我 运行这个 cmd docker logs rest
它告诉我 DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
如何添加此选项 useNewUrlParser
已知我 运行 mongodb 在 docker 容器中
简单
COMPOSER_DATASOURCES='{
"db": {
"useNewUrlParser": true
"name": "db",
"connector": "mongodb",
"host": "mongo"
}
}'
我想为 composer-rest-server 实施 passport-local 策略
COMPOSER_CARD=admin@stschain
COMPOSER_NAMESPACES=never
COMPOSER_AUTHENTICATION=true
COMPOSER_MULTIUSER=true
COMPOSER_PROVIDERS='{
"local": {
"provider": "local",
"module": "passport-local",
"usernameField": "username",
"passwordField": "password",
"authPath": "/auth/local",
"callbackURL":"/auth/local/callback",
"successRedirect": "/",
"failureRedirect": "/",
"setAccessToken": true,
"callbackHTTPMethod": "post"
},
}'
COMPOSER_DATASOURCES='{
"db": {
"name": "db",
"connector": "mongodb",
"host": "mongo"
}
}'
i 运行 此 CMD:docker run -d --name mongo --network
composer_default -p 27017:27017 mongo
用于启动 MongoDB docker 容器,并执行实施此策略所需的所有操作,但是当我 运行这个 cmd docker logs rest
它告诉我 DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
如何添加此选项 useNewUrlParser
已知我 运行 mongodb 在 docker 容器中
简单
COMPOSER_DATASOURCES='{
"db": {
"useNewUrlParser": true
"name": "db",
"connector": "mongodb",
"host": "mongo"
}
}'