From bde9dfc42c588efea3022e00003f63a4d407ad2d Mon Sep 17 00:00:00 2001 From: Vesko Karaganev Date: Wed, 3 Aug 2022 16:11:09 +0100 Subject: [PATCH] Use OTTOMAN_CONNECTION_STRING as connection string The README talks about using an .env file, but the code example used hardcoded credentials. This commit replaces those with the value of the OTTOMAN_CONNECTION_STRING environment variable. --- server.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 3b5c70d..6a0587b 100644 --- a/server.js +++ b/server.js @@ -1,3 +1,4 @@ +const process = require('process'); const express = require('express'); const swaggerUi = require('swagger-ui-express'); const YAML = require('yamljs'); @@ -23,12 +24,7 @@ app.use((err, req, res, next) => { const main = async () => { try { - await ottoman.connect({ - bucketName: 'travel-sample', - connectionString: 'couchbase://localhost:8091', - username: 'Administrator', - password: 'password', - }); + await ottoman.connect(process.env.OTTOMAN_CONNECTION_STRING); await ottoman.start(); const port = 4500; app.listen(port, () => {