Note that it is not mandatory to follow the directory structure suggested here in this book. There are no arbitrary or official rules for how we should structure our app with Koa. There are some skeletons, boilerplates, and frameworks contributed by the Koa community, which you can take a look at by visiting https://github.com/koajs/koa/wiki. Now let's take a closer look at the directory structure in the /src/ directory, where we will develop our API source code, in the following steps:
-
Create the following folders and empty .js files in the /src/ directory as follows:
└── src
├── index.js
├── middlewares.js
├── routes-private.js
├── routes-public.js
├── config
│ └── index.js
├── core
│ └&...