Skip to content

therealslimhsiehdy/asset_apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn

Asset APIs

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact

About The Project

We have a store of Asset objects -- Asset types can either be Satellites or Antennas, and they have specified Asset classes that match a corresponding Asset type.

Here are the 3 endpoints for the server with examples of requests you can make:

POST /assets -- creating an Asset NOTE: This endpoint requires form data as the body, ie {"asset_name": "name_here", "asset_type": "satellite", "asset_class": "dove"}

GET /assets -- showcases all the Assets we have

GET /assets/{name} -- showcases the Asset information for a specified Asset name that's the user provides

Built With

Getting Started

Installation

  1. Create a Python virtual environment:
python -m venv .venv
source .venv/bin/activate
  1. Install requirements into virtual environment:
pip install -r requirements.txt
  1. Start the Flask application:
FLASK_APP=main.py flask run
  1. Use this link to make requests to the server (Postman suggested):
http://127.0.0.1:5000

Testing

Run Pytest with the virtual environment activated:

pytest

Thoughts

If this assignment were in "real life" enterprise work, instead of in memory storing with the dictionary data structure, I would choose to store the information in a database. For example, if you ended an in memory server you'd lose all your information. However, if you have a database with corresponding Flask API servers, you wouldn't lose all your information.

Contact

Rebecca Hsieh - [email protected] - therealslimhsiehdy.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages