Chapter 14: Building a Microservice
In this chapter, we will learn how to build a simple microservice in V using a RESTful approach. To achieve this, we will be using the built-in vweb
and orm
libraries. Additionally, we will leverage the power of SQLite by installing it as a third-party library. With the help of the SQLite library, we will establish a database connection and interact with the database using that connection. We will also use the JSON data format as a form of communication.
In this chapter, we will cover the following topics:
- Introducing
vweb
- Creating a project and organizing files
- Setting up the
vweb
web server - Setting up the utility functions and constants for the microservice
- Implementing RESTful endpoints
- Implementing an endpoint to create a note using HTTP verb
POST
- Implementing an endpoint to retrieve a note by id using HTTP verb
GET
- Implementing an endpoint to retrieve all notes using HTTP verb
GET
- Implementing an endpoint...