我将其用作bitbucket-pipelines.yml
:
image: spittet/node-mongodb
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- service mongod start
- npm test
在测试中,我连接到 mongo db。像这样:
const localhost = process.env.HOSTNAME || "localhost";
mongoose.connect('mongodb://'+localhost+'/testslab');
但这不起作用。我应该如何连接到 bitbucket 管道 mongo db?我应该使用什么主机?