-
Notifications
You must be signed in to change notification settings - Fork 0
Creating an API
In my previous project, I had done almost no server-side work. I was a big part of determining what the API should provide and how requests should look, but my parter built the API itself.
Fortunately, the server folder laid it all out for me. There are subfolders api, auth, components, config, and views. All of the API setup is in the API folder (more details below), auth contains the service that handles all of the authentication, components…, config contains the environment configurations and environment variables, and views...
The API is similarly divided into small modular pieces. Each object in the API has it’s own folder in server/api
. This makes sense. When we query the server for a resource it will look something like GET /api/thing/:id