Generating server code from a specification
In Chapter 8, you learned how to translate your API definition into a machine-readable document that can be used, among other things, to generate server and client code. You examined different specifications and had the chance to understand their differences. Now is the time to take one machine-readable document and convert it into code that runs and powers your API server. This code is meant to act as the prototype of your API because it doesn’t include any business logic.
We’ll focus on one of the specification formats and one of the programming languages. I’ll use the OpenAPI specification format and the Node.js programming language to show you how you can quickly get your API server up and running.
Now, let’s see how you can generate server code using two different approaches. The first approach uses Postman, a popular API platform, so that you can go from your OpenAPI definition document to a fully working...