Oracle Magazine, September/October 2018
Database Developer OPEN SOURCE BY DAN McGHAN Build REST APIs for Node js Part 3 Add routing controller and database logic After our brief detour to create a generic database module its time to continue building out the high level REST API components for Node js discussed in the first article of this series In this article you will add routing controller and database logic to handle an HTTP GET request on an employees API endpoint Note the instructions and steps in this article assume that you have completed the steps in Part 1 of this article series ADDING ROUTING LOGIC Express which creates the web server for this project ships with a Router class that makes it easy to route HTTP requests to the appropriate controller logic Route paths define the URL endpoints of the API and can contain route parameters that capture values in the URL query strings are not part of route paths There are many ways to define the routes for your application For example when the app starts you could read all the files in the controllers directory and autogene ORACLE MAGAZINE SEPTEMBER OCTOBER 2018 65 ORACLE DATABASE
You must have JavaScript enabled to view digital editions.