# Routes scheme Slim+Angular2

**URL:** <https://discourse.slimframework.com/t/routes-scheme-slim-angular2/787>\
**Category:** Questions\
**Created:** [October 9, 2016, 1:28pm UTC](https://discourse.slimframework.com/t/routes-scheme-slim-angular2/787 "2016-10-09T13:28:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndersonDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/andersondev/32/50_2.png) [@AndersonDev](https://discourse.slimframework.com/u/AndersonDev)\
**Post date:** [October 9, 2016, 1:28pm UTC](https://discourse.slimframework.com/t/routes-scheme-slim-angular2/787/1 "2016-10-09T13:28:01Z")

</div>

Maybe question not in right place but here are much good people)

I have a big app on Angular 2 on front. I created back on slim framework. It works good however I not sure in **routes scheme**. Now I have something like:

```auto
$app->group('/locations', function () {
	$this->get('', 'Controllers\LocationsController:allLocations');
	$this->post('', 'Controllers\LocationsController:createLocation');

	$this->group('/{id:[0-9]+}', function () {
	     $this->get('', 'Controllers\LocationsController:getLocation');
             $this->post('', 'Controllers\LocationsController:updateLocation');
        });
});

```

and send request only with **Locations** without dependencies. Know you some article about very good routing scheme?

Thanks!

---

<div class="post-metadata">

**Author:** ![damianopetrungaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/damianopetrungaro/32/236_2.png) [@damianopetrungaro](https://discourse.slimframework.com/u/damianopetrungaro)\
**Post date:** [October 14, 2016, 11:10am UTC](https://discourse.slimframework.com/t/routes-scheme-slim-angular2/787/2 "2016-10-14T11:10:12Z")

</div>

Personally i split all routes in different files and i don’t use group

This is a very handy boilerplate i wrote for little/fast projects

> <https://github.com/damianopetrungaro/slim-boilerplate/tree/master/app/Routes>
>
> //github.com/damianopetrungaro/slim-boilerplate/tree/master/app/Routes

Your structure is ok for me if you use one big route file.  
Splitting the file and removing group is so much more readable.

I haven’t found any specification or best practices for the routing, you can try to read in this old topic:

> [@Best way to configure allowed groups to a route](http://discourse.slimframework.com/t/best-way-to-configure-allowed-groups-to-a-route/121):
>
> Hi, I am currently using laravel for a project, but this framework is too heavy for my needs, and slim seems to fit for now on. I’m trying to estimate the migration time, but I don’t know how to migrate something: In laravel, I have: A Menu class, where I define allowed groups for a specific menu entry. Each menu entry has a key. A Menu that shows only what the connected user can see, based on his groups A “require-group” middleware that checks, for a given route, that the user is allowed A …
