Skip to content

IEPUG/2022_07_REST-API_2

Repository files navigation

Example code for REST API 2 presentation at IEPUG on 7/19/2022

This is a follow-up for the Intro to REST APIs presentation the month before. Example code and slides for that presentation can be found here.

Basic Flask routing

  • rest_server1.py: - Basic Flask setup with Flask route decorators

Using Flask-RESTful routing

  • rest_server2.py: - Flask setup with Flask-RESTful classes

Using Flask Blueprints

  • rest_server3.py: - Moved routes to separate file with Flask Blueprints
  • db_routes3.py: - GET routes for database access

Adding additional HTTP request methods

  • rest_server4.py: - Moved routes to separate file with Flask Blueprints
  • db_routes4.py: - GET, POST, PUT, and DELETE routes for database access

Adding Flask-Login (Final form)

  • rest_server.py: - Moved routes to separate file with Flask Blueprints
  • db_routes.py: - GET, POST, PUT, and DELETE routes for database access
  • admin_routes.py: Admin routes for session control (Login/Logout)

Additional Files

  • db_utils.py: Convenience funcitons for working with the sqlite database
  • rest_test.http: HTTP requests for testing REST API in PyCharm

About

Sample files from REST API 2 Talk on 07/19/2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages