routes/index.jsファイルの変数clients
の使用方法。ここすべてのルートファイルでapp.js変数を使用する方法は?
は私のコードは、あなたが、index.jsでメソッドを定義し、それをエクスポートして作成したメソッドのパラメータとしてクライアントに渡すことができ、
app.js
clients = new cassandra.Client({ contactPoints:[config.contactPoints], keyspace: config.keyspace,authProvider: new cassandra.auth.PlainTextAuthProvider(config.userName, config.password)});
これはExpressアプリケーションですか? – ImClarky
はいこれは明示的なアプリケーション@ImClarky –