ASP.NET Core Web API for Raspberry Pi
186
API
Faster build and availability of Visual Studio development environment are the key advantages of this workflow.
Links: https://app.swaggerhub.com/apis/josemottalopes/contacts-api/1.2.0 https://github.com/josemotta/Api https://hub.docker.com/r/josemottalopes/io.swagger/
ASP.NET Core Web API for Raspberry Pi
Starting from a Swagger API definition, an ASP.NET Core Web API is automatically generated by Swagger Hub. The code is pushed to github and then loaded by a Windows x64 machine and upgraded to ASP.NET Core 2.0, using Visual Studio 2017.
A multi-stage docker image build is accomplished at the speedy Windows x64 machine, generating code of linux-arm framework. The image container is pushed to the cloud and then pulled back into a Raspberry Pi with Raspbian 9.1 stretch installed.
Model:
Restlet generates API and exports swagger.json Swagger Hub imports file and generates server stub x64 machine:
Install Docker Adapts server stub into docker repo: io.swagger Compiles at x64 machine for linux-arm framework Docker push to cloud: josemottalopes/io.swagger Raspberry Pi (hostname "pi")
Raspbian GNU/Linux 9.1 (stretch) Install Docker Docker run: josemottalopes/io.swagger Tests
Go back to x64 machine Access pi-server-stub via browser http://pi:5000/swagger/ui/index.html Commands
x64: Build
docker-compose -f docker-compose.ci.build.yml build docker push josemottalopes/io.swagger:latest
arm: RaspberryPi (hostname "pi")
docker run --privileged -p 5000:5000 josemottalopes/io.swagger
any: Client Test
Content type
Image
Digest
Size
97.9 MB
Last updated
almost 9 years ago
docker pull josemottalopes/io.swagger