I am a beginner at react native mobile development. I need to connect react native and MSSQL database through express js API. Can anyone guide me in this regard? recommend me some tutorials? any one can guide me?
1 Answer
You need to have REST APIs build using expressjs and then these APIs will be taking to your database using the MySQL library for nodejs and at the end, your react application will talk to REST API.
connect to MySQL like this:
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'me',
password : 'secret',
database : 'my_db'
});
connection.connect();
2 Comments
Sanduni Fernando
Thank you. i already have created express backend for website. this system has mobile app also. so how can I already connected mu web application for back end. So I don't know how to connect mobile app for it. please help me.
Sanduni Fernando
where should i implement this code.