Former Googler and friend Chris Smith will be speaking at the Open FSharp conference next week. I will be there too. So, I decided to give F# a try and see how it worked with Google Cloud APIs and how to deploy it to Google App Engine.
I was impressed with the tools for F#. I visited fsharp.org and downloaded F# for my system. Then, I ran
PS > dotnet new mvc -lang F#
and I had a new F# MVC project in my directory. The debugger in Visual Studio Code worked out of the box too:
I added a new controller that calls Google Cloud Vision API to check if an image contains naughty content:
And ran the code:
I added a simple app.yaml, and two command lines later and I’m running it on Google App Engine:
PS > dotnet publish
PS > gcloud beta app deploy ` .\bin\Debug\netcoreapp1.1\publish\app.yaml
Pretty cool. Well done to the F# team for making this so easy for a F# newbie.
The complete code with instructions are available on GitHub.