Express-less Node.js Server Part 2
Tutorial
December 10, 2017
Creating & Routing A Node Server …continued
Today I picked up where I left off yesterday, and got the query from the URL parameters to persist as a JSON object. I learned about the Object.assign()
method which does the trick. After creating an empty object as a global variable (var db = {}
), you can assign data to a target: Object.assign(target, data)
. So for this server I added this into the routing logic to produce the desired result:
// Handle routes |
So that’s the challenge done! The full code is in this gist.
Other Stuff
I spent a good 20 minutes trying to figure out how to take Git Code Lens annotations out of the editor in VS Code. For future reference: shift
+ alt
+ b
!!!!
Up Next
Deploy my value app without the delete function. Hoping I can get that working at some meetups this week, but I’m overdue in trying to deploy on AWS so I will do that first.