Skip to content

Commit

Permalink
fixes #800
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Jun 10, 2024
1 parent 6210234 commit 09e4ad3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs_src/src/components/documentation/Guides.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const guides = [
description:
'Learn how to deploy your app to production and manage your deployments.',
},
{
href: '/documentation/example_app/redirection',
name: 'Redirection',
description:
'Learn how to redirect requests to different endpoints.',
},
]

export function Guides() {
Expand Down
1 change: 1 addition & 0 deletions docs_src/src/components/documentation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const navigation = [
href: '/documentation/example_app/monitoring_and_logging',
},
{ title: 'Deployment', href: '/documentation/example_app/deployment' },
{ title: 'Redirection', href: '/documentation/example_app/redirection' },
{ title: 'Templates', href: '/documentation/example_app/templates' },
{
title: 'SubRouters and Views',
Expand Down
4 changes: 2 additions & 2 deletions docs_src/src/pages/documentation/example_app/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ With the web application deployed and running smoothly, Batman had a powerful ne

<div className="not-prose">
<Button
href="/documentation/example_app/templates"
href="/documentation/example_app/redirection"
variant="text"
arrow="right"
children="Adding a Frontend"
children="Redirection"
/>
</div>

Expand Down
31 changes: 31 additions & 0 deletions docs_src/src/pages/documentation/example_app/redirection.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const description =
"Welcome to the Robyn API documentation. You will find comprehensive guides and documentation to help you start working with Robyn as quickly as possible, as well as support if you get stuck.";

## Redirection

Batman wanted to redirect some endpoints to others. Robyn helped him do so by the following.

```python {{ title: 'Redirection' }}
from robyn import Robyn

app = Robyn(__file__)

@app.get("/")
def index():
return landing()

@app.get("/landing")
def landing():
return "hii!"
```

With increased flexibility achieved by redirection, Batman had a powerful new tool at his disposal. The Robyn framework had provided him with the flexibility, scalability, and performance needed to create an effective crime-fighting application, giving him a technological edge in his ongoing battle to protect Gotham City.

<div className="not-prose">
<Button
href="/documentation/example_app/templates"
variant="text"
arrow="right"
children="Adding a Frontend"
/>
</div>

0 comments on commit 09e4ad3

Please sign in to comment.