Skip to content

Contains all the Endpoints to be used by the i-reporter website

Notifications You must be signed in to change notification settings

gkarumba/i-Reporter-endpoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Maintainability

i-Reporter-endpoints

This repo is a build of the API endpoints for an online reporting platform

RESTful API Endpoints for ireporter

Method Endpoint Description Example
POST /api/v2/reports Creates a new report POST
GET /api/v2/reports Gets all reports payload = {
GET /api/v2/reports/<reportid> Gets a single report by id "flag":"",
PUT /api/v1/reports/<reportid>/edit Edit a specific report by id "location":""
DELETE /api/v2/reports/<reportid> Deletes a specific report by id "comment":""}
PATCH api/v2/reports/status/<reportid> Edits the status
PATCH api/v2/reports/location/<reportid> Edits the location
PATCH api/v2/reports/comment/<reportid> Edits the comment

Getting Started

To get this repo running on your local machine for development and testing purposes. Ensure that you have python 2.7

  1. Create a new folder in the local machine
  2. Open terminal and cd into the folder cd <foldername>
  3. Create a virtual environment virtualenv <nameofvirtualenv>
  4. Activate the virtual env source <nameofvirtualenv>/bin/activate

Prerequisites

To have the repo on your machine run git clone https://github.com/gkarumba/i-Reporter-endpoints.git To install all the dependencies run pip install -r requirements.txt

Running the flask app

To run the flask app

  1. Run export FLASK_APP=run.py

  2. Run export FLASK_ENV=development

  3. Run flask run to start the server

Running the tests

To test the endpoints ensure that Postman is installed in the local machine Run Postman and set the localhost to http://127.0.0.1:5000/ Add the localhost with urls for the various endpoints, for example: http://127.0.0.1:5000/api/v1/reports then start sending the requests e.g POST http://127.0.0.1:5000/api/v1/reports

Deployment

The APIs is hosted on HEROKU and can be access via : HEROKU

Running nosetests

run the following command on terminal : nosetests --with-coverage --cover-package=app

Built With

PYTHON

Versioning

I use GitHub for versioning. For the versions available, there are two available versions.

Author

About

Contains all the Endpoints to be used by the i-reporter website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages