formio / resquel Goto Github PK
View Code? Open in Web Editor NEWEasily convert your SQL database into a REST API using Express.js
License: MIT License
Easily convert your SQL database into a REST API using Express.js
License: MIT License
Please provide as many details as you can:
require('envkey')
const express = require('express')
const resquel = require('resquel')
const Console = require('consola')
const app = express()
const port = process.env.PORT || 3031
app.use(
resquel({
db: {
user: process.env.DBUSER,
password: process.env.DBPASS,
server: process.env.DBHOST,
database: process.env.DBNAME,
port: process.env.DBPORT
},
routes: [
{
method: 'get',
endpoint: '/users',
query: 'SELECT * FROM core_members;'
}
]
})
)
app.listen(port)
Console.log(`Listening on port ${port}`)
To start successfully
$ node index.js
Listening on port 3031 17:45:24
internal/buffer.js:47
throw new ERR_BUFFER_OUT_OF_BOUNDS();
^
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to write outside buffer bounds
at boundsError (internal/buffer.js:47:11)
at Buffer.readUInt8 (internal/buffer.js:137:5)
at Packet.isLast (/Users/daniel/code/ironmarch/api/node_modules/tedious/lib/packet.js:112:29)
at ReadablePacketStream.<anonymous> (/Users/daniel/code/ironmarch/api/node_modules/tedious/lib/message-io.js:91:18)
at ReadablePacketStream.emit (events.js:198:13)
at addChunk (/Users/daniel/code/ironmarch/api/node_modules/readable-stream/lib/_stream_readable.js:291:12)
at readableAddChunk (/Users/daniel/code/ironmarch/api/node_modules/readable-stream/lib/_stream_readable.js:278:11)
at ReadablePacketStream.Readable.push (/Users/daniel/code/ironmarch/api/node_modules/readable-stream/lib/_stream_readable.js:245:10)
at ReadablePacketStream.Transform.push (/Users/daniel/code/ironmarch/api/node_modules/readable-stream/lib/_stream_transform.js:148:32)
at ReadablePacketStream._transform (/Users/daniel/code/ironmarch/api/node_modules/tedious/lib/message-io.js:57:16)
error Command failed with exit code 1.
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.