GithubHelp home page GithubHelp logo

linebot's Introduction

Install Guide:

  • Clone flask-api from gitlag.kfsyscc.org

    $git clone ssh://[email protected]:10022/deve/flask-api.git
    
  • Install pip3 & virtualenv

    • Install pip first
    $sudo apt-get install python3-pip
    $sudo pip3 install virtualenv
    $virtualenv venv
    
  • Install Redis-Server

    $sudo apt update
    $sudo apt install redis-server
    sudo systemctl restart redis.service
    

    Hint! Once you need force stop redis server:

    $cat /lib/systemd/system/redis-server.service
    $sudo mkdir /var/run/redis
    $sudo chown redis /var/run/redis
    $systemctl daemon-reload
    $systemctl stop redis-server
    
  • Install Oracle Client

    $cd flask-api/docker
    $sudo ./instora.sh
    
  • Modify start.sh

    • fixed: usr/bin/redis-server --> #user/bin/redis-server
    $vim start.sh
    
  • Run flask-api

    $cd flask-api
    $source ./venv/bin/activate
    $(venv) .... /pip3 install -r requirements.txt
    $start.sh
    
    2019-04-02 08:18:16 [100454][info] Starting gunicorn 19.7.1
    2019-04-02 08:18:16 [100454][info] Listening at: http://0.0.0.0:5000 (100454)
    2019-04-02 08:18:16 [100454][info] Using worker: threads
    2019-04-02 08:18:16 [100454][info] Server is ready. Spawning workers
    2019-04-02 08:18:16 [100463][info] Booting worker with pid: 100463
    2019-04-02 08:18:16 [100464][info] Booting worker with pid: 100464
    2019-04-02 08:18:16 [100465][info] Booting worker with pid: 100465
    2019-04-02 08:18:16 [100466][info] Booting worker with pid: 100466
    
    • How to change sever IP? $ vim gunicorn_config.py

      • set "bind = os.getenv('GUNICORN*BIND', '172.***._**.___:5000')"

此專案特別超級感謝 輝哥大神 !!

Appendix

  • 每個 API 主要 Folder 下,建議放 index.py,參考程式碼如下:
    from api.route import api_route
    from lib.utils import route_info

    @api_route(rule='', params=None, methods=['GET'])
    def index():
        return route_info('sys')

linebot's People

Contributors

linhui1017 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.