@theniledev/server
Consolidates the API and DB for working with Nile.
Adding an endpoint:
Add the openapi spec
- Find or add to
src
the name of the base property egsrc/tenants
- Add a new folder with new method eg
src/tenants/createTenantUser
- Add an
openapi/paths
folder under the method folder and insert a JSON openapi spec. This helps with conversion - If there are common schemas or responses, add them to
src/openapi
and reference them accordingly - Update
/openapi/index.json
with any modifications, including the file you added/changed -
yarn build
to be sure it works.
Add new function to the sdk
- Add the method (using the method name) and a function for obtaining URL to the base index file with types eg
src/tenants/index
(this should be a lot of copy paste) - Add a test under the method folder to be sure it goes to the correct url.