Dotos %!s(int64=8) %!d(string=hai) anos
pai
achega
4407b9d5fb
Modificáronse 6 ficheiros con 11 adicións e 117 borrados
  1. 0 12
      configs/config.js
  2. 0 2
      package.json
  3. 7 2
      readme.md
  4. 0 97
      utils/dbUtils.js
  5. 0 2
      utils/logUtils.js
  6. 4 2
      views/layout.pug

+ 0 - 12
configs/config.js

@@ -4,17 +4,5 @@ module.exports = {
         title: 'JsonBird',
         author: 'xCss <xioveliu@gmail.com>',
         description: '业界领先的远程 JSON 代理服务'
-    },
-    //mysql config
-    mysql_dev: {
-        host: 'q*******.my3w.com',
-        user: '***********',
-        password: '**********',
-        port: '3306',
-        database: '**************_db',
-        connectionLimit: 10,
-        supportBigNumbers: true,
-        multipleStatements: true,
-        insecureAuth: true
     }
 };

+ 0 - 2
package.json

@@ -25,7 +25,6 @@
     "readme": "./readme.md",
     "homepage": "https://github.com/xCss/JsonBird#readme",
     "dependencies": {
-        "bcryptjs": "^2.3.0",
         "body-parser": "~1.15.1",
         "cluster": "^0.7.7",
         "cookie-parser": "~1.4.3",
@@ -35,7 +34,6 @@
         "helmet": "^2.3.0",
         "leanengine": "^1.2.2",
         "morgan": "~1.7.0",
-        "mysql": "^2.11.1",
         "os": "^0.1.1",
         "pug": "^2.0.0-beta6",
         "serve-favicon": "~2.3.0",

+ 7 - 2
readme.md

@@ -1,6 +1,8 @@
 # JsonBird
 A JSON Remote Agent Service | 一个远程JSON代理服务 
 
+> **:warning:** 由于带宽限制,若要频繁使用代理接口,请致信 xioveliu@gmail.com
+
 **[HomePage](https://bird.ioliu.cn)** | [Demo](https://jsfiddle.net/LNing/duL5Lby7/)
 
 ![npm:v3.10.3](https://img.shields.io/badge/npm-v3.10.3-blue.svg)
@@ -8,7 +10,7 @@ A JSON Remote Agent Service | 一个远程JSON代理服务
 ![node.js support:v0.10.0+](https://img.shields.io/badge/node.js%20supports-v0.10.0+-green.svg)
 ![build:passing](https://img.shields.io/badge/build-passing-green.svg)
 [![license:MIT](https://img.shields.io/badge/license-MIT-blue.svg)](/License)
-[![releases:v1.4.0](https://img.shields.io/badge/releases-v1.4.0-blue.svg)](https://github.com/xCss/JsonBird/releases)
+[![releases:v1.4.2](https://img.shields.io/badge/releases-v1.4.2-blue.svg)](https://github.com/xCss/JsonBird/releases)
 
 ## Table Of Contents
 - [Requirements](#requirements)
@@ -16,6 +18,7 @@ A JSON Remote Agent Service | 一个远程JSON代理服务
 - [You can got](#you-can-got)
 - [What's New](#whats-new)
 - [License](#license)  
+- [Wiki](/wiki/All-APIs)
 
 ## Requirements
 Paddington requires the following to run:
@@ -23,7 +26,7 @@ Paddington requires the following to run:
 - [npm](https://www.npmjs.com/) (normally comes with Node.js)
 
 ## Usage
-> https://bird.ioliu.cn/v1/?url=http[s]://YouWantProxyJSONUrls.com&[?]params1=val1&params2=val2[&callback=fn]
+> https://bird.ioliu.cn/v1?url=http[s]://YouWantProxyJSONUrls.com&[?]params1=val1&params2=val2[&callback=fn]
 
 ## You can got
 1. Enables cross-domain requests to any JSON API
@@ -32,6 +35,8 @@ Paddington requires the following to run:
 ## What's New
 [Please see Release](https://github.com/xCss/JsonBird/releases) 
 
+
+
 ## License
 
 [MIT License](/License)

+ 0 - 97
utils/dbUtils.js

@@ -1,97 +0,0 @@
-//https://github.com/mysqljs/mysql#readme
-var mysql = require('mysql');
-var bcrypt = require('bcryptjs');
-//获取数据库配置
-var config = require('../configs/config').mysql_dev;
-//使用连接池
-var pool = mysql.createPool(config);
-//SESSION_SECRET
-var sessionSECRET = process.env.SESSION_SECRET || "faFJDSLNFFJLsEknnqWSDlweifsNIW";
-//console.log(sessionSECRET);
-//公共连接设置
-var commonFormat = function(callback) {
-    pool.getConnection(function(err, connection) {
-        //console.log(callback);
-        //自定义参数匹配设置
-        connection.config.queryFormat = function(query, values) {
-            if (!values) return query;
-            return query.replace(/\:(\w+)/g, function(txt, key) {
-                if (values.hasOwnProperty(key)) {
-                    return this.escape(values[key]);
-                }
-                return txt;
-            }.bind(this));
-        };
-        callback && callback(err, connection);
-    });
-};
-
-//存储
-module.exports = {
-    //添加/修改数据
-    set: function(params) {
-        var password = '12345' + sessionSECRET;
-        var salt = bcrypt.genSaltSync(10);
-        var hash = bcrypt.hashSync(password, salt);
-        //console.log(hash);
-        //console.log(bcrypt.compareSync(password + 'x', hash));
-        // var sql = 'select 1+1 as test';
-        // pool.query(sql, function(err, rows, fields) {
-        //     console.log(err);
-        //     console.log(rows);
-        //     console.log(fields);
-        // });
-        var sql = 'select MD5("123456") as calc';
-        // commonFormat(function(err, connection) {
-        //     connection.query(sql, { id: 1 + 1 }, function(err, rows) {
-        //         //console.log(err);
-        //         console.log(rows);
-        //         console.log(rows.length)
-        //     });
-        // });
-    },
-    //获取数据
-    get: function(key) {
-
-    },
-    //删除数据
-    del: function(key) {
-
-    },
-    //事务
-    transaction: function(params) {
-        commonFormat(function(err, connection) {
-            //Transaction Begin
-            connection.beginTransaction(function(err) {
-                if (err) throw err;
-                var keys = [];
-                var vals = [];
-                connection.query('insert into :table(' + keys.join(',') + ') values(' + vals.join(',') + ') ', params, function(err, result) {
-                    if (err) {
-                        return connection.rollback(function() {
-                            throw err;
-                        });
-                    }
-                    var insertId = result.insertId;
-                    //Transaction Next
-                    connection.query('insert into :table(' + keys.join(',') + ') values(' + vals.join(',') + ')', params, function(err, result) {
-                        if (err) {
-                            return connection.rollback(function() {
-                                throw err;
-                            });
-                        }
-                        //Transaction Commit
-                        connection.commit(function(err) {
-                            if (err) {
-                                return connection.rollback(function() {
-                                    throw err;
-                                });
-                            }
-                            console.log('Transaction Success!');
-                        });
-                    });
-                });
-            });
-        });
-    }
-};

+ 0 - 2
utils/logUtils.js

@@ -1,7 +1,5 @@
-//var storage = require('./dbUtils');
 module.exports = {
     print: function(params) {
-        //storage.set({});
         var arr = ['-------------------------------------'];
         // var date = new Date();
         // var month = date.getMonth() + 1;

+ 4 - 2
views/layout.pug

@@ -3,7 +3,9 @@ html
   head
     title= title
     link(rel='stylesheet', href='/static/css/style.css')
-    meta( name="viewport",content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0")
-    meta( name="author",content="xCss xioveliu@gmail.com")
+    meta(name="viewport",content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0")
+    meta(name="author",content="xCss xioveliu@gmail.com")
+    meta(name="keywords",content="JsonBird,API代理服务,API接口代理,远程接口代理,代理,接口,Proxy Remote apis")
+    meta(name="description",content="业界领先的远程 JSON 代理服务")
   body 
     block content