Questions tagged [express-4]

Express is a minimalist web framework for Node.js which provides a set of features for web and mobile applications.

Express is a minimalist web framework for Node.js which provides a set of features for web and mobile applications.

Helpful links

105 questions
0
votes
1 answer

How do I debug Node.JS in Visual Studio 2015 without changing /bin/www?

To improve productivity, I am starting to use Visual Studio 2015 instead of Sublime Text for Node JS and Express.js 4 projects. With the new structure of Express 4 and npm standard, the starting point of the project is in bin folder with www file,…
hoanganh17b
  • 867
  • 1
  • 11
  • 25
0
votes
1 answer

How to delegate route processing in express?

I have expressjs application with straitfort route processing like the following: app.route('/').get(function(req, res, next) { // handling code; }); app.route('/account').get(function(req, res, next) { // handling code; …
Erik
  • 14,060
  • 49
  • 132
  • 218
0
votes
1 answer

(NodeJS, MySQL, AngularJS, Express 4.0) Risks of not blocking my api/routes for users?

At the moment I am working on a CRUD app that I am going to deploy (someday) and use for my own startup company. However I am nowhere near finishing this product and I stumbled upon a question that I can't seem to figure out. I am using Express to…
Mick
  • 324
  • 4
  • 14
0
votes
1 answer

Embed yammer group feed into jade (node.js view engine)

I am trying to embed the yammer group feed into my node.js website (Express4) jade view. Here's what I am doing in the jade view : extends layout block content h2 #{title} h3 #{message} p Use this area to provide additional information. …
dparkar
  • 1,934
  • 2
  • 22
  • 52
0
votes
1 answer

Is it required to specify view_engine in express 4?

I am using react as my client side JS and REST API's using Express 4. Do I really need to specify the view_engine parameter? I thought I dont need any view engine coz there is no serve side rendering. I use gulp to compile all the react jsx and it…
user1870400
  • 6,028
  • 13
  • 54
  • 115
0
votes
1 answer

Express: how can I get the app from the router?

I know I can get the Express app from inside an individual route with: req.app However I need to start a single instance of a module inside routes/index.js, i.e.: var myModule = require('my-module')(propertyOfApp) How can I get the express app…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0
votes
1 answer

Returning success using res.send

I am using combination of Node and Angualr JS alongwith express-4 In my code I am trying to send newSourceId via res.send . I am able to get the newSourceId but when I send it using res.send it gets into error instead of getting in to success. I…
Abhishek
  • 878
  • 12
  • 28
0
votes
2 answers

Express 4: router syntax

I am using Express 4 with the new router. At least one thing continues to confuse me, and it is a syntax problem - I am wondering if there is a regex that can do what I want. I have a standard REST api, but I want to add batch updates, so that I can…
user5047085
0
votes
1 answer

How to configure express js 4 to serve some pages in http and others in https?

Is there any way to configure a node js application with express js 4 to serve some pages under http protocol and other, those which need more security, in https? I describe my problem: I'm developing a shop online and I want to display certain…
christiansr85
  • 867
  • 19
  • 40
0
votes
3 answers

Express 4.0 Failed to Look up view in "/views" directory

I am working with Express 4.0 and Express3-handlebars libraries for NodeJS. Here is the configuration app.set('views', path.join(__dirname, 'views/')); app.engine('hbs', hbs({defaultLayout: 'main', extname: '.hbs'})); app.set('view engine',…
user3739383
  • 37
  • 1
  • 8
0
votes
2 answers

Can't get cookies to send with request in Express 4

Here's my initial config: var session = require('express-session'); var cookieParser = require('cookie-parser'); app.use(session({ saveUninitialized: true, resave: false, genid: function(req) { return…
dsp_099
  • 5,801
  • 17
  • 72
  • 128
0
votes
1 answer

how to access param inside middleware in express.js 4.x?

I want to modify route param inside middleware: express = require 'express' bodyParser = require 'body-parser' app = express() app.use(bodyParser.json()) // app.param(...) is deprecated app.use (req, res, next) -> console.log req.params.id //…
user606521
  • 14,486
  • 30
  • 113
  • 204
0
votes
1 answer

How to pass a parameter to a self executing anonymous function

I have in my server.js this line of code: require('../routes/allRoutes')(app) And this works fine when my allRoutes.js looks like this: module.exports = function(app){ app.get("/", function(req, res){ res.render ...... }); } But…
user1177440
0
votes
0 answers

can't call included middleware in express 4's Router.use()

I wrote a function that redirects no authorized users module.exports = function(req, res, next) { if (!req.session.authUser) { // if AJAX request if(req.xhr) helpers.send_failure(not_authorized()); else …
Amir Anvarov
  • 107
  • 1
  • 9
0
votes
1 answer

why do I get Error: ENOENT open error when trying to render a doT.js view

I am trying out doT.js for the first time and have written a very basic server setup: 'use strict'; var express = require('express'); var app = express(); var doT = require('express-dot'); var pub = __dirname+'/public'; var vws =…
Finglish
  • 9,692
  • 14
  • 70
  • 114