This commit is contained in:
sieadev
2025-04-21 14:23:15 +00:00
parent 06303b9fc5
commit 6d8f5b7fac
61 changed files with 632 additions and 21 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>In the example above, we create an <code>/api</code> router and register the <code>MyHandler</code> class to handle requests on the <code>/api/hello</code> endpoint.</p><p>This is because the <code>path</code> property of the <code>RouteInfo</code> annotation is relative to the base path of the router, which in this case is <code>/api</code>.</p><p>Visiting <code>/api/hello</code> from your browser will result in the response <code>Hello, world!</code>.</p></div></div></main><footer class="VPDocFooter" data-v-e6f2a212 data-v-1bcd8184><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-1bcd8184><span class="visually-hidden" id="doc-footer-aria-label" data-v-1bcd8184>Pager</span><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link prev" href="/flash/core-concepts/request-response.html" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Request and Response</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/flash/core-concepts/websockets.html" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Websockets</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"flash_advanced_fullstack-development.md\":\"DFJ2Nfm_\",\"flash_advanced_handler-default-implementations.md\":\"CRxyEpV6\",\"flash_core-concepts_handlers.md\":\"BZuBmBSX\",\"flash_core-concepts_request-handler.md\":\"fjZWLpOw\",\"flash_core-concepts_request-response.md\":\"BuTSfkDO\",\"flash_core-concepts_server-router.md\":\"DIWo49Yl\",\"flash_core-concepts_websockets.md\":\"ByGVX96c\",\"flash_file-serving_dynamic-file-server.md\":\"DY_r4ecH\",\"flash_file-serving_static-file-server.md\":\"BvN0FZB2\",\"flash_index.md\":\"CAxgiNVz\",\"flash_introduction_installation.md\":\"BEOKwAAp\",\"index.md\":\"sDYgKdFh\",\"mobot_index.md\":\"Be0Zoetq\",\"serverlibraries_index.md\":\"CeIqSPIs\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Pixel Services Docs\",\"description\":\"Documentation for all public Pixel Services projects.\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"https://static.pixel-services.com/static/assets/pservices_logo.png\",\"sidebar\":{\"/flash/\":[{\"text\":\"Introduction\",\"collapsed\":false,\"items\":[{\"text\":\"Getting Started\",\"link\":\"/flash\"},{\"text\":\"Installation\",\"link\":\"/flash/introduction/installation\"}]},{\"text\":\"Core Concepts\",\"collapsed\":false,\"items\":[{\"text\":\"Handlers\",\"link\":\"/flash/core-concepts/handlers\"},{\"text\":\"RequestHandler\",\"link\":\"/flash/core-concepts/request-handler\"},{\"text\":\"Request and Response\",\"link\":\"/flash/core-concepts/request-response\"},{\"text\":\"Server Router\",\"link\":\"/flash/core-concepts/server-router\"},{\"text\":\"Websockets\",\"link\":\"/flash/core-concepts/websockets\"}]},{\"text\":\"File Serving\",\"collapsed\":false,\"items\":[{\"text\":\"Static Files Server\",\"link\":\"/flash/file-serving/static-file-server\"},{\"text\":\"Dynamic Files Server\",\"link\":\"/flash/file-serving/dynamic-file-server\"}]},{\"text\":\"Advanced\",\"collapsed\":false,\"items\":[{\"text\":\"Handler Default Implementations\",\"link\":\"/flash/advanced/handler-default-implementations\"},{\"text\":\"Fullstack Development\",\"link\":\"/flash/advanced/fullstack-development\"}]}],\"/mobot/\":[{\"text\":\"MoBot Documentation\",\"items\":[{\"text\":\"Getting Started\",\"link\":\"/mobot\"}]}],\"/serverlibraries/\":[{\"text\":\"ServerLibraries Documentation\",\"items\":[{\"text\":\"Getting Started\",\"link\":\"/serverlibraries\"}]}]}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"flash_advanced_fullstack-development.md\":\"DFJ2Nfm_\",\"flash_advanced_handler-default-implementations.md\":\"CRxyEpV6\",\"flash_core-concepts_handlers.md\":\"BZuBmBSX\",\"flash_core-concepts_request-handler.md\":\"fjZWLpOw\",\"flash_core-concepts_request-response.md\":\"BuTSfkDO\",\"flash_core-concepts_server-router.md\":\"DIWo49Yl\",\"flash_core-concepts_websockets.md\":\"ByGVX96c\",\"flash_file-serving_dynamic-file-server.md\":\"DY_r4ecH\",\"flash_file-serving_static-file-server.md\":\"BvN0FZB2\",\"flash_index.md\":\"CAxgiNVz\",\"flash_introduction_installation.md\":\"BEOKwAAp\",\"index.md\":\"tEfotoPq\",\"mobot_commands_command-arguments.md\":\"Cuc3b3v9\",\"mobot_commands_creating-a-command.md\":\"DrPP2R0G\",\"mobot_configuration_custom-configs.md\":\"BBg-YrVf\",\"mobot_configuration_default-config.md\":\"CWK17AB-\",\"mobot_configuration_non-yaml-configs.md\":\"D1wDyLf4\",\"mobot_creating-a-module_module-lifecycle.md\":\"BfG9RjVD\",\"mobot_creating-a-module_modules-introduction.md\":\"BWpvzdqx\",\"mobot_events_creating-a-listener.md\":\"By59Lqsu\",\"mobot_events_events-introduction.md\":\"cEArHWcq\",\"mobot_index.md\":\"Bklchsn4\",\"mobot_introduction_installation.md\":\"D8x3Ns7p\",\"serverlibraries_index.md\":\"CeIqSPIs\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Pixel Services Docs\",\"description\":\"Documentation for all public Pixel Services projects.\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"https://static.pixel-services.com/static/assets/pservices_logo.png\",\"sidebar\":{\"/flash/\":[{\"text\":\"Introduction\",\"collapsed\":false,\"items\":[{\"text\":\"Getting Started\",\"link\":\"/flash\"},{\"text\":\"Installation\",\"link\":\"/flash/introduction/installation\"}]},{\"text\":\"Core Concepts\",\"collapsed\":false,\"items\":[{\"text\":\"Handlers\",\"link\":\"/flash/core-concepts/handlers\"},{\"text\":\"RequestHandler\",\"link\":\"/flash/core-concepts/request-handler\"},{\"text\":\"Request and Response\",\"link\":\"/flash/core-concepts/request-response\"},{\"text\":\"Server Router\",\"link\":\"/flash/core-concepts/server-router\"},{\"text\":\"Websockets\",\"link\":\"/flash/core-concepts/websockets\"}]},{\"text\":\"File Serving\",\"collapsed\":false,\"items\":[{\"text\":\"Static Files Server\",\"link\":\"/flash/file-serving/static-file-server\"},{\"text\":\"Dynamic Files Server\",\"link\":\"/flash/file-serving/dynamic-file-server\"}]},{\"text\":\"Advanced\",\"collapsed\":false,\"items\":[{\"text\":\"Handler Default Implementations\",\"link\":\"/flash/advanced/handler-default-implementations\"},{\"text\":\"Fullstack Development\",\"link\":\"/flash/advanced/fullstack-development\"}]}],\"/mobot/\":[{\"text\":\"Introduction\",\"items\":[{\"text\":\"Installation\",\"link\":\"/mobot/introduction/installation\"}]},{\"text\":\"Creating a Module\",\"collapsed\":false,\"items\":[{\"text\":\"Getting Started\",\"link\":\"/mobot/creating-a-module/modules-introduction\"},{\"text\":\"Module Lifecycle\",\"link\":\"/mobot/creating-a-module/module-lifecycle\"}]},{\"text\":\"Commands\",\"collapsed\":false,\"items\":[{\"text\":\"Creating a Command\",\"link\":\"/mobot/commands/creating-a-command\"},{\"text\":\"Command Arguments\",\"link\":\"/mobot/commands/command-arguments\"}]},{\"text\":\"Events\",\"collapsed\":false,\"items\":[{\"text\":\"What are Events?\",\"link\":\"/mobot/events/events-introduction\"},{\"text\":\"Creating a Listener\",\"link\":\"/mobot/events/creating-a-listener\"}]},{\"text\":\"Configs\",\"collapsed\":false,\"items\":[{\"text\":\"Default Config\",\"link\":\"/mobot/configuration/default-config\"},{\"text\":\"Custom Configs\",\"link\":\"/mobot/configuration/custom-configs\"},{\"text\":\"Non Yaml Configs\",\"link\":\"/mobot/configuration/non-yaml-configs\"}]}],\"/serverlibraries/\":[{\"text\":\"ServerLibraries Documentation\",\"items\":[{\"text\":\"Getting Started\",\"link\":\"/serverlibraries\"}]}]}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>