The above script will create an Express Router with routes that mirror the folder structure, with the
possibleAPIMethods
file names being the verb handlers.
Example:
Given the folder structure
-- A
|
| -- B
|
| -- C
|
| -- get.js
it would create an API handler for the following request
GET /A/B/C
and
-- A
|
| -- post.js
| -- get.js
will handle
POST /A
GET /A
and finally
-- A
|
| -- :id
|
| -- get.js
will handle
GET /A/1234
GET /A/asdf324232980=3242
GET /A/<...pretty much anything>