If you save the code above into a file called, for example: “ simple.py“, and then run it from the command line, you have a Python (starting point) web service you can call from FMP! Python micro-service starting point code below: Check out “pip” and other simple installers for python add-ons like Flask.) (You will need to have Python installed, of course and you will need to install Flask. Instead, the example code below is just a “see how simple it is to get started and see all you can do…” kind of thing. NOTE: this service example below isn’t intended to be “production ready”– as you’d certainly have much more error handling and other code. (Note: Most modern programming languages, including Java snd Python, support micro-services.)īelow is about the simplest micro-service you can write. be passed simply letting the micro-service handle translations or other messy details. The caller of the micro-service doesn’t need to know any details how the micro-service code works. Service programming tools manage dependencies - automatically!.Externalize loops to keep loops out of slow FMP scripts.Puts you in charge of the service code.Extremely powerful (get the full power of free third-party libraries often written in fast C language).NO restrictive plug-in license agreements.NO FMP plug-in installation and configuration for every copy of FMP you might have.Allows any application that can do a GET to use the service (Terminal, FMP, Firefox, Opera, Chrome, ….).Cross platform so the service can reside … anywhere (Linux, Mac, Win).No need to “re-invent the wheel” in a proprietary FMP-only CF to duplicate existing tested/free library routines.Enables you to tap into powerful modern languages.Uses industry standard protocols (HTTP verbs!).
0 Comments
Leave a Reply. |