yogasaikrishna / todo-app Goto Github PK
View Code? Open in Web Editor NEWSimple TODO list app using Node.js, Express and MySQL
Simple TODO list app using Node.js, Express and MySQL
I have try same example but i am change database connection parameter but i m received error
Connection { pool: null, init: [Function], acquire: [Function] }
Server listening on port 8000
Connection Done : undefined
Connection Error : { Error: getaddrinfo ENOTFOUND 192.151.152.180:3306 192.151.152.180:3306:3306
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
--------------------
at Protocol._enqueue (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\mysql\lib\protocol\Protocol.js:141:48)
at Protocol.handshake (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\mysql\lib\protocol\Protocol.js:52:41)
at PoolConnection.connect (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\mysql\lib\Connection.js:136:18)
at Pool.getConnection (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\mysql\lib\Pool.js:48:16)
at Connection.acquire (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\connection.js:17:15)
at Todo.get (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\models\todo.js:7:16)
at D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\routes.js:10:12
at Layer.handle [as handle_request] (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\express\lib\router\layer.js:95:5)
at next (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (D:\Gajendrasinh Zala\PictureThis\PictureThisAPI\node_modules\express\lib\router\route.js:112:3)
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '192.151.152.180:3306',
host: '192.151.152.180:3306',
port: 3306,
fatal: true }
can you please help me how to solve this i am new in node server
I have api to update todo list through "PUT" Method as below:
var connection = require('../connection');
connection.acquire(function(err, con) {
con.query('update todo_list set ? where id = ?', [todo, todo.id], function(err, result) {
con.release();
if (err) {
res.send({status: 1, message: 'TODO update failed'});
} else {
res.send({status: 0, message: 'TODO updated successfully'});
}
});
});
But when i am trying to call this API through Postman and assign one value does not exist in the db(Ex: id= 100000). My result always return success without error.
Please help me resolve this issue. Thank you so much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.