Skip to content

Instantly share code, notes, and snippets.

@jamescalam
Created August 29, 2020 09:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamescalam/fed1c86fbc2b74eedde28618cbaf9f73 to your computer and use it in GitHub Desktop.
Save jamescalam/fed1c86fbc2b74eedde28618cbaf9f73 to your computer and use it in GitHub Desktop.
Snippet showing multiple API endpoints setup with Flask.
class Users(Resource):
# methods go here
pass
class Locations(Resource):
# methods go here
pass
api.add_resource(Users, '/users') # '/users' is our entry point for Users
api.add_resource(Locations, '/locations') # and '/locations' is our entry point for Locations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment