This is a great way, to simulate a small Webserver for simple requests. Instead of providing a real Webserver for small APIs, you can use PowerAutomate for this.
For this, the 'When a HTTP Request is received' trigger action is used to respond to a HTTP request.
The mentioned approach follows the idea of an REST API. REST (Representational State Transfer) is a software architectural style that defines a set of constraints to be used for creating Web APIs (Application Programming Interfaces). A REST API is a type of API that follows the REST architectural style and allows communication between systems using HTTP protocols.