/REST

A simple Open Campus Data API service.

Primary LanguageJavaScriptGNU General Public License v2.0GPL-2.0

Open Campus API

Build Status Codeship Status for Tri-Try/REST

Reqirements:

  • Python 3.4+
  • npm

Build:

  • Local machine:

    First, you need to install dependencies and crawling the data.

    # Install dependencies
    npm install apidoc -g
    pip install -r requirements.txt
    
    python manage.py syncdb
    python manage.py crawl
    
    # generate static documents
    make apidoc
    
    # Run server
    python manage.py runserver

    Open http://127.0.0.1:5000 in your browser!

  • Docker build:

    # Build all depencies in docker environment.
    docker-compose build
    
    # Start a running container
    docker-compose up -d
    
    docker-compose run web python manage.py syncdb
    docker-compose run web python manage.py crawl
    
    # generate static documents
    docker-compose run web make apidoc

    In docker build, doesn't need to specify port number, nginx will make it. Just open http://${DOCKER_CONTAINER_IP} in browser.