Virtual Env:
sudo apt-get install python-pip
sudo pip install virtualenv
Node:
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
Webpack:
sudo npm install -g webpack
Clone and change directory:
git clone https://github.com/tomkoker/bookflip && cd bookflip
Create python virtual environment:
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
Install dependencies:
pip install -r requirements.txt
npm install
Create instance folder and config file:
mkdir instance && touch instance/config.py
Initialize database:
python init_db.py
Build and start the server:
webpack
python run.py
Responses All responses will look like the following:
{
"status": "success", // 'error' or 'fail'
"data": {...}
}
Routes
Location | Input | Description |
---|---|---|
/api/signup |
username, password, email | Creates a new user |
/api/activate/<payload> |
Activates user | |
/api/login/ |
username, password | Logs in user |
/api/logout/ |
Logs out user | |
/api/me/ |
Returns user status | |
/api/new-listing , changing to: POST: /api/listings/ |
listing | Creates a new listing |
/api/all , changing to: GET: /api/listings/ |
Shows all listings | |