2 Creating your first microservice
This chapter covers:
- Our philosophy of development
- Establishing your single-service development environment
- Building a microservice for video streaming
- Setup for production and development
- Using Node.js to run our microservice
We are aiming to assemble a microservices-based application that consists of multiple microservices. But before we can build multiple microservices we must first learn how to build one microservice! We have to start somewhere and in this chapter we’ll create our first microservice. It will be simple microservice and do very little, but it will illustrate the process so that you can understand it and repeat it.
This first microservice will be a simple HTTP server that can deliver streaming video to a user watching in a web browser. This is the first step on our road to building FlixTube: our video streaming application. Video streaming might sound very difficult! But the simple code we are examining at this stage should not present much difficulty.
In this book, our microservices are programmed with JavaScript and run on Node.js. It’s important to note though that we could use any tech stack for our microservices. Building applications with microservices gives us a lot of freedom in the tech stack we use.