Skip to content

lennykamande/alu-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackOverflow-lite

Introduction

Build Status Coverage Status

Run in Postman

Run in Postman

Features

  1. Users can create an account
  2. Users can login
  3. Users can logout

Installing

Step 1

Create directory $ mkdir alu-test

$ cd alu-test

Create and activate virtual environment

$ virtualenv env

$ source env/bin/activate

Clone the repository here or

git clone git@bitbucket.org:lennymanyeki/alu-test.git

Install project dependencies

$ pip install -r requirements.txt

Step 2

Set up database and virtual environment & Database

Go to postgres terminal and create the following databases

Main database

# CREATE DATABASE database_name ;

Test database

# CREATE DATABASE test_database_name ;

Step 3

Storing environment variables

export FLASK_APP="run.py"
export APP_SETTINGS="development"
export DATABASE_URL="dbname='database_name' host='localhost' port='5432' user='postgres' password='root'"
export DATABASE_TEST_URL="dbname='test_database_name' host='localhost' port='5432' user='postgress' password='root'"

Step 4

Running the application

$ python run.py

Step 5

Testing

$ nosetests app/tests

API-Endpoints

Users Endpoints : /api/v1/

Method Endpoint Functionality
POST /auth/signup Create a user account
POST /auth/login Sign in a user
POST /auth/logout Sign out a user

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published