Browse Source

Fix: reverting bin file to previous

pull/13/head
oof1lab 7 years ago
parent
commit
54d6a1ffae
  1. 20
      bin/index.js
  2. 2
      lib/util/cmd.helper.js
  3. 2
      package.json

20
bin/index.js

@ -1,13 +1,13 @@
#! /usr/bin/env node #! /usr/bin/env node
const morgan = require('morgan'); const morgan = require('morgan');
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
const express = require('express'); const express = require('express');
const sqlConfig = require('commander'); const sqlConfig = require('commander');
const mysql = require('mysql'); const mysql = require('mysql');
//const dataHelp = require('./lib/util/data.helper.js');
const Xapi = require('./lib/xapi.js'); const Xapi = require('../lib/xapi.js');
const cmdargs = require('./lib/util/cmd.helper.js'); const cmdargs = require('../lib/util/cmd.helper.js');
cmdargs.handle(sqlConfig) cmdargs.handle(sqlConfig)
@ -29,25 +29,11 @@ let mysqlPool = mysql.createPool(sqlConfig);
/**************** START : setup Xapi ****************/ /**************** START : setup Xapi ****************/
// console.log('');
// console.log('');
// console.log(' Generating APIs at speed of your thoughts.. ');
// console.log('');
// console.log('');
let t = process.hrtime();
let moreApis = new Xapi(sqlConfig,mysqlPool,app); let moreApis = new Xapi(sqlConfig,mysqlPool,app);
moreApis.init((err, results) => { moreApis.init((err, results) => {
app.listen(sqlConfig.portNumber) app.listen(sqlConfig.portNumber)
var t1 = process.hrtime(t);
var t2 = t1[0]+t1[1]/1000000000
// console.log('| |');
// console.log("| xmysql took : %d seconds",dataHelp.round(t2,1));
// console.log('| |');
// console.log(' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ');
}) })
/**************** END : setup Xapi ****************/ /**************** END : setup Xapi ****************/

2
lib/util/cmd.helper.js

@ -11,7 +11,7 @@ program.on('--help', () => {
}) })
program program
.version('0.1.1') .version('0.1.2')
.option('-h, --host <n>', 'hostname') .option('-h, --host <n>', 'hostname')
.option('-d, --database <n>', 'database schema name') .option('-d, --database <n>', 'database schema name')
.option('-u, --user <n>', 'username of database / root by default') .option('-u, --user <n>', 'username of database / root by default')

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "xmysql", "name": "xmysql",
"version": "0.1.1", "version": "0.1.2",
"description": "One command to generate REST APIs for any MySql database", "description": "One command to generate REST APIs for any MySql database",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

Loading…
Cancel
Save