azat-co / expressworks

Learn Express.js from the author of one of the best books on Express.js—Pro Express.js— with this workshop that will teach you basics of Express.js.
MIT License
709 stars 220 forks source link

What's In Query error when using res.send(obj) #90

Closed UziTech closed 8 years ago

UziTech commented 8 years ago

using res.send(obj) gives an error

                 ACTUAL                                 EXPECTED                
────────────────────────────────────────────────────────────────────────────────

   "{"                                 !=    "{\"results\":\"recent\",\"type\":\"quote\",\"page\":\"8\"}"
   "  \"results\": \"recent\","        !=                                       
   "  \"type\": \"quote\","            !=                                       
   "  \"page\": \"8\""                 !=                                       
   "}"                                 !=                                       

────────────────────────────────────────────────────────────────────────────────

using res.end(JSON.stringify(obj)) works

UziTech commented 8 years ago

same thing with JSON ME

azat-co commented 8 years ago

@UziTech the output shows you exactly what the problem is, i.e., whitespaces

azat-co commented 8 years ago

you might want to look into https://github.com/azat-co/expressworks/issues/70