Questions tagged as 'express'

1
answer

NodeJS multiple url in app.get Express

I have several (almost all) urls that point to a single page and use the following line to send the file: app.get('*', function(req, res){ res.sendFile(__dirname+'/home.html'); }); But with that, also files that I request to my site an...
asked by 21.07.2018 / 15:18
1
answer

Can ExpressJS be used in production?

I recently saw a course where ExpressJS was used for backend testing in JSON for an application and I was amazed, but I came up with several questions: Could it be used in production? Can an alternative be the most used technologies currently in...
asked by 07.02.2018 / 18:13
1
answer

'Can not set headers after they are sent.' Express.js

I'm trying to send the 'name' variable to the client side, but it's only working when I run a respons.end() when I use two, returns this error: > 'Can't set headers after they are sent.' Server router.get('/:eventnick', func...
asked by 14.01.2018 / 18:26
1
answer

.NET application C # express style NodeJS

But for a few features I'd like my project to respond to some simple HTTP Rest requests. As the project will handle COM + and other things, I will do it in C #. The issue is, I do not want to have to deal with IIS and wanted something simpler...
asked by 12.12.2017 / 20:52
1
answer

Error: Most Middleware in app nodejs

Running nodejs application. I received this error: I ran my application with the command node app.js Versions: node: 8.9.2 npm: 5.5.1 express: 4.15.5 App.jscode:/***Moduledependencies.*/varexpress=require('express');varroutes...
asked by 07.12.2017 / 00:05
1
answer

Synchronous function to check files in NodeJS?

I'm creating PDF's on my NodeJS server using the Express framework and the PdfMake library. If someone looks at my profile I will see that I asked a question about corrupted PDF after download. It turns out that I have discovered that the files...
asked by 15.08.2017 / 21:29
1
answer

How to install express in ubuntu through npm?

When I try to install Express in Ubuntu with the command npm install express , this error occurs: npm WARN enoent ENOENT: no such file or directory, open '/home/flavio/package.json' npm WARN enoent ENOENT: no such file or directory, open...
asked by 09.05.2017 / 20:30
1
answer

Node JS and MongoDB - Return data from a model to a route

I'm new with Node JS + MongoDB and I have a question about two days that I could not figure out how to solve it. My problem is this: I have a route file that makes a call to a model, as in the example below: Route file: 'use strict'...
asked by 03.04.2017 / 14:47
1
answer

TCP Server + Web Server in same application

Next person, I have some ideas about a project and I have some doubts ... 1st Is it possible to create a TCP Server that will handle the connection with the Client along with a Web Server using express that will have functions like start, sto...
asked by 06.05.2017 / 05:45
2
answers

how to direct a page synchronously in nodeJS

Good afternoon I have a page called index.js in the route folder of nodejs express. When the pendingAprovals page is called I would like the index to call a webservice to send a JSON to the pendingAprovals, but the node treats the asynchronou...
asked by 24.01.2017 / 14:59