Some other important concepts to be conscious of when building APIs with Koa include the following:
- Cross-origin resource sharing (CORS): Koa-cors is a great middleware that helps to enable CORS on Koa-built APIs. This ensures that you are able to connect to your API from other origins.
- Environment variables: You can environment variables, such as the port that you want the application to run in, database credentials, and so on, in a separate file, and load them into your variables by using the popular dotenv JavaScript module (https://www.npmjs.com/package/dotenv).