{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1656","repository_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack","labels_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1656/labels{/name}","comments_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1656/comments","events_url":"https://api.github.com/repos/angular-fullstack/generator-angular-fullstack/issues/1656/events","html_url":"https://github.com/angular-fullstack/generator-angular-fullstack/issues/1656","id":135902948,"number":1656,"title":"Creating new route for an Endpoint.","user":{"login":"kalcheat","id":17441113,"avatar_url":"https://avatars.githubusercontent.com/u/17441113?v=3","gravatar_id":"","url":"https://api.github.com/users/kalcheat","html_url":"https://github.com/kalcheat","followers_url":"https://api.github.com/users/kalcheat/followers","following_url":"https://api.github.com/users/kalcheat/following{/other_user}","gists_url":"https://api.github.com/users/kalcheat/gists{/gist_id}","starred_url":"https://api.github.com/users/kalcheat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalcheat/subscriptions","organizations_url":"https://api.github.com/users/kalcheat/orgs","repos_url":"https://api.github.com/users/kalcheat/repos","events_url":"https://api.github.com/users/kalcheat/events{/privacy}","received_events_url":"https://api.github.com/users/kalcheat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-23T23:46:57Z","updated_at":"2016-02-24T01:04:05Z","closed_at":"2016-02-24T01:04:05Z","body":"After i created a new endpoint with `yo angular-fullstack:endpoint` i wanted to create some routes.\r\n\r\nThats what my new index.js looks like:\r\n\r\n```\r\n'use strict';\r\n\r\nimport {Router} from 'express';\r\nimport * as controller from './question.controller';\r\nimport * as auth from '../../auth/auth.service';\r\n\r\nvar router = new Router();\r\n\r\nrouter.get('/',  controller.index);\r\nrouter.get('/:id', auth.hasRole('admin'), controller.show);\r\nrouter.get('/my', controller.my);\r\nrouter.post('/', auth.isAuthenticated(), controller.create);\r\nrouter.put('/:id', auth.hasRole('admin'), controller.update);\r\nrouter.patch('/:id', auth.hasRole('admin'), controller.update);\r\nrouter.delete('/:id', auth.hasRole('admin'), controller.destroy);\r\n\r\nexport default router;\r\n```\r\n\r\neverything works except for `router.get('/my', controller.my);`.\r\n\r\nI added a `export function my(req, res, next)` in question.controller.js.\r\n\r\nThe error i receive is: `UnauthorizedError: No authorization token was found`.\r\n\r\nIt's like the middleware is calling `auth.isAuthenticated()` in the `/my ` route even though it is not supposed to.\r\n\r\nWhen i look at the template 'user'-endpoint, the `router.get('/me', controller.me);` works fine, but not for my new endpoint.\r\n\r\nWhat am i missing here?"}}