> For the complete documentation index, see [llms.txt](https://ronaldaug.gitbook.io/sim-rest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ronaldaug.gitbook.io/sim-rest/routes.md).

# Routes

## How to add routes?

Routes must be declare inside **index.php**

## $router Parameters

* First parameter = **route**
* Second parameter = **function**

```javascript
$router->get(
  '/home', // home route
  function(){} // function
);
```

## Declare a simple GET method route

Add /**about** route in `index.php` as below

```javascript
/**
 * About Page
 */
$router->get('/about',function(){
    echo "Welcome to about page";
});
```

## Point to views folder

You can require normal php file as below

```javascript
/**
* Require File
*/
$router->get('/about',function(){
  require __DIR__ . '/views/about.php';
});
```
