Oracle Magazine, May/June 2018
Database Developer OPEN SOURCE CRUD functionality on the EMPLOYEES table in the HR sample schema By the end of this series you should be able to make decisions about whats best for your own projects This first article focuses on web server basics Future articles will cover topics such as database basics including connection pooling handling various types of HTTP requests and more TARGET ENVIRONMENT For consistency the instructions I use throughout the series will assume that youre working with the Oracle Database developer VM and that Node js version 8 or higher is installed in the VM See this post for instructions on setting up this type of environment I generally prefer to run Node js in my host OS and communicate with the database in the guest VM You can adapt the instructions to do this if you want just be aware that doing so will require additional installation steps to get the driver working on your platform HIGH LEVEL COMPONENTS I like to organize my REST APIs into four core components or layers Incoming HTTP requests will usually touch each of these layers in turn There may be a lot more going on depending on the features an API supports but the following components are required Web server The role of the web server is to accept incoming HTTP requests and send responses There are many options for web servers in Node js At the lowest level you could use the built in modules such as http https and http2 For most ORACLE MAGAZINE MAY JUNE 2018 89
You must have JavaScript enabled to view digital editions.