{"id":5294,"date":"2022-09-18T08:30:37","date_gmt":"2022-09-18T12:30:37","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5294"},"modified":"2022-09-18T08:32:18","modified_gmt":"2022-09-18T12:32:18","slug":"adonisjs-group-routing-and-controller-management","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/","title":{"rendered":"AdonisJS: Group Routing and Controller Management"},"content":{"rendered":"<p>Let&#8217;s start AdonisJS Group routing and controller management in the code now by creating some routes and controllers.<\/p>\n<p>For anyone unaware of the term routing in terms of web development, it is a mapping of URLs and their handlers that you want to handle your app.<\/p>\n<p>Now, we have the AdonisJS Router pretty well covered, and let&#8217;s go ahead and move into cleaning up our route files by extracting our route definition&#8217;s route handlers into what&#8217;s called a controller and out of the route definition itself.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5296\" src=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/building-a-web-app-with-adonisjs.jpg\" alt=\"building-a-web-app-with-adonisjs\" width=\"1050\" height=\"525\" srcset=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/building-a-web-app-with-adonisjs.jpg 1050w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/building-a-web-app-with-adonisjs-980x490.jpg 980w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/building-a-web-app-with-adonisjs-480x240.jpg 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1050px, 100vw\" \/><\/p>\n<h3>What is a Controller<\/h3>\n<p><a href=\"https:\/\/docs.adonisjs.com\/guides\/controllers\">Controllers<\/a> are a JavaScript Class that is the default export of its file. By default, <a href=\"https:\/\/docs.adonisjs.com\/guides\/controllers#controllers-location\">AdonisJS controllers<\/a> reside within the app\/Controllers\/HTTP directory. A specific Http directory exists because we can have different types of controllers, such as WebSocket controllers.<\/p>\n<pre class=\"prettyprint\">\/\/ app\/Controllers\/Http\/PostsController.ts\r\n\r\nexport default class PostsController {\r\n}\r\n<\/pre>\n<p>Firstly, within AdonisJS it&#8217;s common to have a Controller per resource, for example for a Post model we did have a <strong>PostsController<\/strong>, for a Series model we&#8217;d have a <strong>SeriesController<\/strong>, and for a Topic model we did have a <strong>TopicsController<\/strong>.<\/p>\n<h5><strong>So now, for the following route definition like below<\/strong><\/h5>\n<pre class=\"prettyprint\">Route.get('\/posts', async ({ view }) {\r\nreturn view.render('posts\/index')\r\n})\r\n<\/pre>\n<p>Also, we did move the route handler from the route definition below<\/p>\n<pre class=\"prettyprint\">Route.get('\/posts', \/* Goodbye route handler *\/)\r\n<\/pre>\n<h6><strong>Let\u2019s see to the PostsController below<\/strong><\/h6>\n<pre class=\"prettyprint\">\/\/ app\/Controllers\/Http\/PostsController.ts\r\n\r\nexport default class PostsController {\r\npublic async index({ view }) {\r\nreturn view.render('posts\/index')\r\n}\r\n}\r\n<\/pre>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<p>After then, to say the route definition to use the <strong>PostsController<\/strong> and specifically and it is index method, we did provide an object path string as the second argument in our route definition but of the handler itself instead.<\/p>\n<pre class=\"prettyprint\">Route.get('\/posts', 'PostsController.index')\r\n<\/pre>\n<h3>Creating A Controller<\/h3>\n<p>When you need to create a controller, as with most things in AdonisJS, here we have two options. We can create the file and I always prefer to <a href=\"https:\/\/docs.adonisjs.com\/guides\/controllers#make-controller-command\">create my controllers<\/a>.<\/p>\n<pre class=\"prettyprint\">node ace make:controller --help\r\n-------------------------------\r\nMake a new HTTP controller\r\n\r\nUsage: make:controller &lt;name&gt;\r\n\r\nArguments\r\nname Name of the controller class\r\n\r\nFlags\r\n-r, --resource Add resourceful methods to the controller class\r\n-e, --exact Create the controller with the exact name as provid\r\n\r\nSo, based on the above code, in order to create our posts controller, now we want to run the following command\r\n\r\nnode ace make:controller Post\r\n-----------------------------\r\nCREATE: app\/Controllers\/Http\/PostsController.ts\r\n<\/pre>\n<h3>TypeScript and the HttpContext<\/h3>\n<p>At present, one thing you may consider is that AdonisJS provides a commented-out line importing the type HttpContextContract when you create a new non-resource controller.<\/p>\n<p>Since this is the TypeScript type for our HttpContext object. When we define our route handlers directly in the route definition for AdonisJS has the ability to provide the type for the HttpContext object that is provided as the argument for our callback function.<\/p>\n<pre class=\"prettyprint\">\/\/ \u2193 AdonisJS can provide the type automatically\r\nRoute.get('\/posts', async ({ view }) =&gt; {\r\nreturn view.render('posts\/index')\r\n})\r\n<\/pre>\n<h3>Default Controllers<\/h3>\n<p>Therefore, when you create a new controller without any resource flag, this is what AdonisJS will start you with, and note the HttpContextContract import that is commented out for your convenience.<\/p>\n<pre class=\"prettyprint\">\/\/ import { HttpContextContract } from '@ioc:Adonis\/Core\/HttpContext'\r\n\r\nexport default class PostsController {\r\n}\r\n<\/pre>\n<p><strong><em>Love to Code? We\u2019re Your Helping Partner,\u00a0<a href=\"https:\/\/www.cloudsurph.com\/love-to-code\/\">click here for<\/a>\u00a0\u00a0<a href=\"https:\/\/www.cloudsurph.com\/love-to-code\/\">Buy Our Service<\/a><\/em><\/strong><\/p>\n<p>After then, when you create a new controller with the resource flag, this is what AdonisJS will start you with.<\/p>\n<p>And you can note the HttpContextContract is imported and set as the type for each of the parameters of the method.<\/p>\n<pre class=\"prettyprint\">import { HttpContextContract } from '@ioc:Adonis\/Core\/HttpContext'\r\n\r\nexport default class PostsController {\r\npublic async index ({}: HttpContextContract) {\r\n}\r\n\r\npublic async create ({}: HttpContextContract) {\r\n}\r\n\r\npublic async store ({}: HttpContextContract) {\r\n}\r\n\r\npublic async show ({}: HttpContextContract) {\r\n}\r\n\r\npublic async edit ({}: HttpContextContract) {\r\n}\r\n\r\npublic async update ({}: HttpContextContract) {\r\n}\r\n\r\npublic async destroy ({}: HttpContextContract) {\r\n}\r\n}\r\n<\/pre>\n<h3>Namespacing Controllers and Routes<\/h3>\n<p><a href=\"https:\/\/docs.adonisjs.com\/guides\/controllers#route-namespacing\">Namespacing<\/a> is a way to group files and code based on permissions, functionality, or really any other reason that you need to group files and code together for your application.<\/p>\n<p>Now we could say our HTTP Controllers are namespaced to App\/Controllers\/Http.<\/p>\n<p>And we could say our Websocket controllers are namespaced to App\/Controllers\/Websocket.<\/p>\n<h3>Creating A Controller Namespace<\/h3>\n<p>Here we give some Controller Namespace that usages are common:<\/p>\n<pre class=\"prettyprint\">App\/{namespace}\/Controllers\/Http\r\n\r\nApp\/Controllers\/Http\/{namespace}\r\n\r\nApp\/Modules\/{namespace}\/Controllers\/Http\r\n<\/pre>\n<p>So now, we want a new <strong>PostsController<\/strong> within the Namespace Admin and we could run the following Ace CLI command to create that Namespace and Controller like the below command<\/p>\n<pre class=\"prettyprint\">node ace make:controller Admin\/Post --resource\r\n----------------------------------------------\r\nCREATE: app\/Controllers\/Http\/Admin\/PostsController.ts\r\n<\/pre>\n<h3>Pointing A Route to A Namespace<\/h3>\n<p>AdonisJS provides a method that we can chain off our route definition called <strong>namespace<\/strong> and that we can use to define the Namespace to use for the Controller in our application<\/p>\n<pre class=\"prettyprint\">Route.group(() =&gt; {\r\n\r\n\/\/ this will use the controller at:\r\n\/\/ app\/Controllers\/Http\/Admin\/PostsController.ts\r\nRoute.get('\/posts', 'PostsController.index')\r\n\r\n\/\/ \u2193 informs all inner routes to use controllers defined here\r\n}).namespace('App\/Controllers\/Http\/Admin').prefix('admin')\r\n<\/pre>\n<p><strong><em>You can check our previous article:\u00a0<a href=\"https:\/\/www.cloudsurph.com\/adonisjs-rest-api-crud-setup\/\">AdonisJS: REST API simple CRUD Operation<\/a>. IF you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/em><\/strong><\/p>\n<p>Finally, we have got our route definitions all cleaned up.<\/p>\n<p>And using Controllers and we are already starting to discuss resources.<\/p>\n<p>Now would be a great time to dive into resources further and fully learn them.<\/p>\n<p>If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s start AdonisJS Group routing and controller management in the code now by creating some routes and controllers. For anyone unaware of the term routing in terms of web development, it is a mapping of URLs and their handlers that you want to handle your app. Now, we have the AdonisJS Router pretty well covered, [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5295,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[152,157,25,158,159,1],"tags":[54,47,105,103,48,113],"class_list":["post-5294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adonisjs","category-centos-7","category-web-hosting-virtualization","category-linux-basics","category-linux-server","category-virtual-private-servers","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AdonisJS: Group Routing and Controller Management -<\/title>\n<meta name=\"description\" content=\"In this Article we&#039;ll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes &amp; Controllers\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AdonisJS: Group Routing and Controller Management -\" \/>\n<meta property=\"og:description\" content=\"In this Article we&#039;ll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes &amp; Controllers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-18T12:30:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-18T12:32:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"AdonisJS: Group Routing and Controller Management\",\"datePublished\":\"2022-09-18T12:30:37+00:00\",\"dateModified\":\"2022-09-18T12:32:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/\"},\"wordCount\":739,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/AdonisJS-Group-routing-and-controller-management.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"AdonisJS\",\"CentOS 7\",\"Cloud Hosting\",\"Linux Basics\",\"Linux Server\",\"VPS Servers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/\",\"name\":\"AdonisJS: Group Routing and Controller Management -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/AdonisJS-Group-routing-and-controller-management.jpg\",\"datePublished\":\"2022-09-18T12:30:37+00:00\",\"dateModified\":\"2022-09-18T12:32:18+00:00\",\"description\":\"In this Article we'll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes & Controllers\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/AdonisJS-Group-routing-and-controller-management.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/AdonisJS-Group-routing-and-controller-management.jpg\",\"width\":1264,\"height\":760,\"caption\":\"AdonisJS-Group-routing-and-controller-management\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/adonisjs-group-routing-and-controller-management\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AdonisJS: Group Routing and Controller Management\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AdonisJS: Group Routing and Controller Management -","description":"In this Article we'll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes & Controllers","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/","og_locale":"en_US","og_type":"article","og_title":"AdonisJS: Group Routing and Controller Management -","og_description":"In this Article we'll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes & Controllers","og_url":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2022-09-18T12:30:37+00:00","article_modified_time":"2022-09-18T12:32:18+00:00","og_image":[{"width":1264,"height":760,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"AdonisJS: Group Routing and Controller Management","datePublished":"2022-09-18T12:30:37+00:00","dateModified":"2022-09-18T12:32:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/"},"wordCount":739,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["AdonisJS","CentOS 7","Cloud Hosting","Linux Basics","Linux Server","VPS Servers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/","url":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/","name":"AdonisJS: Group Routing and Controller Management -","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg","datePublished":"2022-09-18T12:30:37+00:00","dateModified":"2022-09-18T12:32:18+00:00","description":"In this Article we'll learn about AdonisJS Group routing and controller management, Introducing AdonisJS - Routes & Controllers","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/09\/AdonisJS-Group-routing-and-controller-management.jpg","width":1264,"height":760,"caption":"AdonisJS-Group-routing-and-controller-management"},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/adonisjs-group-routing-and-controller-management\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"AdonisJS: Group Routing and Controller Management"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5294"}],"version-history":[{"count":2,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5294\/revisions"}],"predecessor-version":[{"id":5298,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5294\/revisions\/5298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5295"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}