Skip to content

jefferson10147/unet-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask REST API with MongoDB

This is a REST API using python's microframework Flask, and NoSQL database MongoDB with Its mongo Atlas cloud manager. This API provides information of students at UNET, you can also make others CRUD operations like INSERT, PUT, or DELETE, but yow need to create an user and login to use JWT, to more information about this contact repo owner.

To run this API on your local machine

1- Clone this project, on your local machine:

$ git clone https://github.com/jefferson10147/unet-api.git

2- Create a virtual env inside the folder:

$ python3 -m venv your_venv

3- Activate env:

$ source your_venv/bin/activate

4- Install dependencies:

$ pip install -r requirements.txt

5- Create and export variables to .flaskenv file:

$ touch .flaskenv
$ echo "FLASK_APP=main.py" > .flaskenv

Also you can export another variables to put aplication into development mode:

$ echo "FLASK_ENV=development" >> .flaskenv

6- Create an .env file with these variables

secret_key=your_app_secret_key
jwt_secret_key=your_jwt_secret_key
admin_key=your_admin_key
username_from_db=your_mongoDB_username
password_from_db=your_mongoDB_password
database_name=your_mongoDB_database

7- Run your app:

 $ flask run

If you are using a local mongo database, you need to edit this variable at app.settings.py:

MONGO_URI = YOUR_MONGO_URI

You can check all endpoints when you are running this API on your local machine: DOCS

API online

There is an online version of this API currently running at Heroku cloud. Visit Home page. You can try all search endpoints, but not Insert, Update, and Delete operations. See online documentation at DOC

Releases

No releases published

Packages

No packages published