Questions tagged [node.js-client]

35 questions
0
votes
2 answers

How to query mysql before starting http server in nodejs

A simple question, I use nodejs for HTTP restful API service. Now I want query some mysql data before http server start, the code snippet: var price = -1; var userId = 'some user provided value'; var sql = 'SELECT max(price) FROM users WHERE…
linbo
  • 2,393
  • 3
  • 22
  • 45
0
votes
1 answer

how to connect node.js rest client with UI

I am new to node.js. I have a question regarding connecting my node.js with UI. I have a node.js server which produces rest API with basic authentication. I have written a node.js rest client which will use this APi and print the Json in the command…
Sau
  • 2,109
  • 6
  • 21
  • 22
0
votes
0 answers

Working Node.js modules into an application directory structure

I've begun using Node.js to make web applications. It's really awesome. I've come across a few modules that I want to incorporate into my build. I can work with the modules in Terminal after a global npm install. When it comes time to add them to my…
terra823
  • 92
  • 1
  • 10
-1
votes
3 answers

Why not print the date?

This is my code, there are 2 files: file b.js module.exports.data = function() { return new Date(); } file a.js var a = require("./b") var http = require('http') http.createServer(function(req, res) { res.writeHead(200,…
Mark
  • 59
  • 10
-1
votes
2 answers

Undefined method flash in the view of node.js

Problem in accessing flash messages on view in node.js In my Controller this.req.flash('info','successfully submited'); this.redirect("/home"); In my home view I am not able to get flash messages as req.flash('info'); EDIT In controller…
user3680001
  • 91
  • 1
  • 7
1 2
3