2

I want to make requests for two databases using express and mysql modules and listen on port 8000.

1
  • Can you provide any code? Commented Jul 25, 2017 at 14:09

1 Answer 1

2

You could create multiple db connections using mysql node package like:

var mysql      = require('mysql');

var connection = mysql.createConnection({...});
var otherConnection = mysql.createConnection({...});

See node-mysql documentation

createConnection creates a new, separate database connection object on each call.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.