Implementing a RESTful API, and have setup a file structure like so:
|-- api
`-- entity
|-- models.d.ts
|-- models.ts
`-- routes.ts
Admin/sudo routes could go in api/admin/entity_name.ts
or api/entity/admin.ts
.
Former is useful because all admin controls are in one place, easier to audit, standardise, turn off all admin access &etc. Latter is handy because it's very close to the "normal user" implementation.
Which option is best?