Once we run the program, the HTTP server will start locally listening on port 8080.
Next, browsing http://localhost:8080/employee/get/foo will give us the Hello, followed by the employee name with the status code as 200, as a response in the browser:
On the other hand, accessing http://localhost:8080/employee/get/bar will return us an HTTP error with the message Name Not Found and an error code of 500:
Let's understand the program we have written:
- We defined a NameNotFoundError struct with two fields—Code of type int and