Skip to content

Naruto0/microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microservice

REST API to create, update and delete a product as defined in the task.

Easy develop/deploy

setup the database

Classic python-flask application setup

install requirements

  • create and activate Python virtualenv (I prefer python3)
  • install pip install -r requirements.txt

setup environment variables

change ENVVARS to fit your system (you may take inspiration from .env_example)

export FLASK_APP=micro  # for developement
export DATABASE=postgres://clerk:spersecret@localhost:5432/catalog

Or you can use dotenv module and load .env from base folder.

Create database using interactive Python shell with SQLAlchemy method create_all()

>>> from micro.database import db
>>> db.create_all()

Run the application

$ flask run

Middleware

Use wsgi in deployment. There is used wsgi.ini with heroku on mockup server.

$ flask db init
$ flask db migrate

About

REST API to create, update and delete a product

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published