Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
docs: add API route standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwigoric committed Nov 29, 2023
1 parent c30ad38 commit bc96142
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
44 changes: 44 additions & 0 deletions docs/topics/Express-Routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Express Routes

The route paths define the endpoints at which requests can be made.

Depending on the HTTP method used, the Express router will call the corresponding method handler function.

## CRUD Operations

The following table shows the HTTP methods and their corresponding Express router methods:

| HTTP Method | Express Router Method | CRUD Operation | Description |
| ----------- | --------------------- |----------------|--------------------------------|
| GET | `router.get()` | Read | Retrieve information |
| POST | `router.post()` | Create | Send information to the server |
| PUT | `router.put()` | Create | Create a new resource |
| PATCH | `router.patch()` | Update | Update an existing resource |
| DELETE | `router.delete()` | Delete | Delete an existing resource |

## Route Paths

The route paths define the endpoints at which requests can be made.

Route paths can be strings, string patterns, or regular expressions.

### Resource Naming

For this project, we follow the industry standard of naming conventions,
which you may find [here](https://restfulapi.net/resource-naming/).

<seealso>
<category ref="uh">
<a href="Admin.md" />
<a href="Authenticating-Logging-In.md" />
<a href="Loans.md" />
<a href="Deposits.md" />
<a href="Profiles.md" />
</category>
<category ref="ds">
<a href="Naming.md" />
<a href="Comments.md" />
<a href="Code-Style.md" />
<a href="Git-Commit-Messages.md" />
</category>
</seealso>
13 changes: 7 additions & 6 deletions docs/ucwa.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
start-page="Introduction.md">

<toc-element topic="Introduction.md"/>
<toc-element topic="Coding-Standards.md">
<toc-element topic="Naming.md"/>
<toc-element topic="Comments.md"/>
<toc-element topic="Code-Style.md"/>
</toc-element>
<toc-element topic="Git-Commit-Messages.md"/>
<toc-element topic="User-Handbook.md">
<toc-element topic="Authenticating-Logging-In.md"/>
<toc-element topic="Loans.md">
Expand All @@ -34,4 +28,11 @@
<toc-element topic="Notification-Settings.md"/>
</toc-element>
</toc-element>
<toc-element topic="Coding-Standards.md">
<toc-element topic="Naming.md"/>
<toc-element topic="Comments.md"/>
<toc-element topic="Code-Style.md"/>
</toc-element>
<toc-element topic="Git-Commit-Messages.md"/>
<toc-element topic="Express-Routes.md"/>
</instance-profile>

0 comments on commit bc96142

Please sign in to comment.