Posts

Showing posts with the label mysqljs

x-devapi unable to connect to database in Google app-engine

x-devapi unable to connect to database in Google app-engine I am deploying a simple nodejs server to App-engine which works well except for the database connection using the X-devapi . I am getting this error: nodejs X-devapi All routers failed. All routers failed. Here is the code I use: 'use strict'; const express = require('express'); const mysqlx = require('@mysql/xdevapi'); const app = express(); app.get('/', (req, res) => { const options = { user: 'user_name', password: '@pass',host: 'XX.XXX.XX.XXX' /*Here I used Public IP address on the of the SQL instance*/,port: XXXX /*I assigned port 8080 here*/, schema: 'db_name' }; (async function () { let session; try { session = await mysqlx.getSession(options); const collection = await session.getSchema(options.schema).createCollection('collection'); await collection.add({ name: 'foo' }).execute(); await collection.find().fields(...