Node.js app on Heroku. Getting started -


starting documentation: getting started on heroku node.js(https://devcenter.heroku.com/articles/getting-started-with-nodejs). trying put own thing together.

inside db.ejs 1 can read code:

<ul>     <% results.foreach(function(r) { %>         <li><%= r.id %> - <%= r.name %></li>     <% }); %> </ul> 

and here "results" array coming query (inside index.js)

client.query('select * test_table', function(err, result) {.... 

now here comes question:

how "result" inside db.ejs? (what right syntax?), when inside index.js, use query returning value instead of array.

for example:

client.query('select max(id) test_table', function(err, result) {....

i tried code unchanged in db.ejs, not result.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -