Skip to content

amcm329/exercise_fast_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast API Exercise

Full Name: Aarón Martin Castillo Medina


The following project consists in the development of a system that creates a API REST.

The tool used for API REST is Fast API (0.111.0) and Docker.

It's important to install Docker before this execution, whose instructions are not included in this README.

The project's structure is the following:

.
|-- app
| ´-- app.py 
| ´-- requirements.txt 
|-- sources
| `-- foo.txt
|-- Dockerfile
|-- simulation_interactions.py


I briefly explain each one of these elements:

  • app.py - the file that contains the Fast Api server.
  • requirements.txt - Python libraries that are required for the project.
  • foo.txt - file required to maintain the sources folder.
  • Dockerfile - file requested to initialize the server.
  • simulation_interactions.py - file created to emulate the actions from the user perspective (requests).

In order to execute the code by using docker, you should utilize the following commands:


docker build --tag docker_fast_api .

(Don't forget the dot at the end)

And then:

docker run -d --name fast_api_final -p 80:80 docker_fast_api

Regarding the considerations mentioned for the project:

PERSISTANCE

  • In the container, the number of counts per endpoint are stored in a file called counter.txt, so everything will be modified and stored there..

SECURITY

  • I am keen on security by obscurity, which means that each one of the functionalities does exactly what it's needed, even the script simulation_interactions.py contains this essence as it represents only the necessary actions that a user or a client-side script would carry out.

WAYS OF TESTING

Or there's even the possibility of carry out some tests by using Postman por instance (functionality not included in this code):

imagen

imagen

imagen


About

Code for endpoints simulations with Fast API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published