Skip to content

aydinnemati/my_api_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Api

its an api to get users and save them in mysql database,read,and divition of two numbers.

Installation and Packages

Use the package manager pip to install fastapi.

pip install fastapi

Use the package manager pip to install uvicorn.

pip install uvicorn

Use the package manager pip install pytest-cov.

pip install pytest-cov

and for using database you should install mysql. after installing mysql,you need to change connections settings in code its not recommanded but you can make a database named my_api and a user for it named admin with password admin too.

Usage

from fastapi import Fastapi

app = Fastapi()

@app.post("/")
.
.
.
(etc...)

Run App

for runnig this api you can type this command in root directory.

uvicorn main:app

Testing units

for use test unit with coverage together can use this command in root directory.

pytest --cov main

just for using it you should change first test name and phone every time unless it raises an error.

Contributing

post and get requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages