Skip to content

Commit

Permalink
route example code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BK1031 committed Aug 27, 2024
1 parent 0556d55 commit a6206db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Rincon currently supports the following HTTP Methods:

Routes with the same path and service name will automatically be "stacked". This just means that their methods will be combined into one registration in Rincon.

```c
```
New York: /users [GET]
New York: /users [POST]
---
Expand All @@ -203,7 +203,7 @@ New York: /users [GET,POST]

If the existing or new route method is `*`, then the stacked method will simply be the wildcard method.

```c
```
New York: /users [*]
New York: /users [POST]
---
Expand All @@ -214,21 +214,21 @@ New York: /users [*]

By default, `OVERWRITE_ROUTES` is set to `false`. This means that if you attempt to register a route that has a conflict with an existing route, it will be rejected. Usually these conflicts arise from two routes attached to different services having an overlap in their methods.

```c
```cpp
New York: /users [GET]
San Francisco: /users [GET] # cannot be registered
San Francisco: /users [GET] // cannot be registered
```

Even if the newer route has a higher method coverage than the existing route, the registration will be rejected as long as `OVERWRITE_ROUTES` is set to `false`.

```c
```
New York: /users [GET]
San Francisco: /users [GET,POST] # cannot be registered
```

To ensure that your routes are registered successfully, make sure there are no method overlaps.

```c
```
New York: /users [GET]
San Francisco: /users [POST,PUT] # no conflict, will be registered successfully!
```
Expand All @@ -237,7 +237,7 @@ San Francisco: /users [POST,PUT] # no conflict, will be registered successfully!

When `OVERWRITE_ROUTES` is set to `true`, any conflicting registrations will not be rejected. Instead the new registration will replace the existing one.

```c
```
New York: /users [GET]
San Francisco: /users [GET]
---
Expand All @@ -246,7 +246,7 @@ San Francisco: /users [GET]

If there are multiple conflicting routes, they will all be replaced.

```c
```
New York: /users [GET]
Boston: /users [POST]
Los Angelos /users [DELETE]
Expand Down

0 comments on commit a6206db

Please sign in to comment.