express's questions - Chinese 1answer

42.454 express questions.

I'm trying to destroy the cookie on the client side but can't seem to figure out how to. I've tried the few ways that passport and some answers on SO provided but I'm at a loss as to how to clear the ...

I am very confused about how MongoClient.connect is supposed to be used. I have an express app that uses MongoDB and I'm working on deploying it with docker. When using docker-compose up, the app ...

app.js // registerPartials for Admin hbs.registerPartials(__dirname+'/views/admin/partials/') // registerPartials for User hbs.registerPartials(__dirname+'/views/user/partials/') Folder Structure ...

Here is my express app code app.get('/books',function(req,res){ var {keyword} =req.query; connection.query('SELECT * from books', function (error, results, fields) { if (error) throw ...

I'm in the process of upgrading a NodeJS application from v4.X to v8.X that uses PassportJS. Compounding my problem is the fact that I'm new to Passport and I'm rebuilding the app inside of a Docker ...

I am getting this error when running a simple sequelize.js query for my model. Executing (default): CREATE TABLE IF NOT EXISTS `Books` (`id` INTEGER PRIMARY KEY, `title` VARCHAR(255), `author` ...

I'm having problems with populate() method of mongoose api. I have a schema called list and another called tasks. Basically what I want is to populate the tasks array which is inside the list schema ...

So, one can attempt to fetch the following JSON object: $ curl -i -X GET http://echo.jsontest.com/key/value/anotherKey/anotherValue HTTP/1.1 200 OK Access-Control-Allow-Origin: * Content-Type: ...

I'm new to next.js so maybe I'm missing something very stupid. I want to use custom routes so I created a server.js file and changed my package.json command to node server.js. This is the entire ...

I have a simple scenario. I am following Max tutorial. My http://localhost:3000/message always returns index page. That is only the first route is working. The new route is not working. I am simply ...

I made a HTTP API using Express in Node.js for CRUD operations. This works partly, but when I make a GET request an error shows up: TypeError: Converting circular structure to JSON. Other HTTP ...

I am trying to use express Cors with my resitfy server and it doesn't seem to be denying requests coming from other ips. I am working locally so I tried setting origin to a random public ip but all of ...

I'm using NextJs (v-5.0.0) and I want to serve my application (in production only) under a specific subdomain. For example for this url http://url.com/post it should be http://url.com/subdomain/post, ...

How to merge multiple responses into one json? Thanks! When i run the code i get error: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client .... var trackArrayReg = ...

I'm building an app and all works fine while I'm in developer mode. Everythink works as it should. But when I package my app with electron-builder, app opens but it doesnt start express server and app ...

i've created a small API using Node/Express and trying to pull data using Angularjs but as my html page is running under apache on localhost:8888 and node API is listen on port 3000, i am getting the ...

so i have a route where i get a decision from mongoose but i also want to json res the logged in userId . I can't get this value to res.data on react even if i see it on postman // postman test ...

I need filter the products of a collection by category id which is a reference field. product.js const restful = require('node-restful') const mongoose = restful.mongoose const productSchema = new ...

How to get content from: <p id1="p-1-1"> Samsung Galaxy S8 Dual </ p> and pass it to the param: <a href="/about?param=HERE" class="btn2"> Learn more </a> The contents of ...

I have this format in my db [{ "birth-date": "18/12/2010", "babies": [{ "id":1, "name": "James", "age": 8, }, { "id":2, "name": "John", "age": 4, }] }] so I want to ...

app.get('*', function(req, res) { res.sendFile(__dirname + '/dashboard/index.html'); }); In the above code 404 is redirecting to index.html, If the set 404.html & reload my page first time my ...

I am developing a html page using node js. My code for run app.js is app.get('/',function(req,res){ res.render('index',{"data":["name" , "ABC"] }); }); i am trying to show name on my HTML ...

i am having main database in which i am having a collection name 'mainDBS' and i am inserting a record in the mainDBSschema bt during the connection is on i wont get the record at the time when ...

Given Two Object of same property name and some property values are not same find the similar object element and return the non-similar object element //main.js var Obj1 = { a:'ds', ...

I have a NodeJs Express app running on the Google Cloud Server, I was just seeing my logs where I noticed below log. A (availInAfter, availOutAfter) { A // When the callback is used in an ...

I'm hoping someone can either find what I'm doing wrong or can verify what I'm discovering to be true. On a post to a node.js server there just isn't any way in the world request.on('data') works. ...

I want to serve all my static html pages built by NextJs export function from a specific directory. This directory looks kind of wired to me: Do I really have to configure every route in express ...

Based on some condition, i want to either consume a node/express REST API from a JAVA Servlet filter or continue to a Java Restful API(Rest-easy). The decision to either continue with JAVA or direct ...

I am having some problems with my API routes in a node App. I switched the 'to' portion of my Nodemailer and now all of a sudden it is giving me problems with the Async in my 'Post' Action. I keep ...

I'm newbie with node.js and express and I'm trying to protect some url's with a token. I generate the token correctly but when I post a form with this token I've got an error in my browser with this ...

I'm working on my Electron app with Express server and when I build it with electron-packager, I get an error. Uncaught Exception: Error: spawn node ENOENT at exports._errnoException (util.js:...

I am very to nodeJS, I have the following file as router.js: exports.redirectlogin = function ( req, res, next ) { // some logic res.redirect( '/login ', {redirecturl: req.originalUrl} ); }; ...

First time I am going to work with node.js I suppose to create API service. I have gone through many article. I loved the serverless framework, where I got a yml file which contains the route ...

I am trying to implement some anti-spamming mechanism into my app. I came across the limiter package. I am confused after reading their example: var RateLimiter = require('limiter').RateLimiter; var ...

I want to send multiple objects in link and be able to get them in my server side. Currently I am trying this: <a href="?page={{ page }}+?filter={{data.sort}}">{{ page }}</a> The result ...

I am attempting to build a single page app using Express.js. On my index.html page, I have a basic form, which upon submit will make a request to an API, retrieve the data, parse it, and then I want ...

Im trying to query a record from database using this criteria: VITAMINS + ZINC 100MG/10MG PER 5ML SYRUP This is what my request url looks like: http://localhost:4200/api/search?key=VITAMINS%20+%...

When i run nodemon, it shows [nodemon] 1.17.4 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node app.js` But when i run npm start, everything works fine. ...

I am trying to change the name of the image im uploading to the server using multer which gives the file a random name. I user multer.diskStorage method to do so as described in the documentation but ...

I am building a register system in my nodejs application. I am using Sequelize js as ORM. This is my controller exports.activateaccount=function(req,res,next){ var token=req.params.token; indexmodel....

I stucked multiple action's in a single form(dropdown list). I can POST only a single action. admin.html <form action="/start" method="post" id="tableForm"> <select id="myselect" size="5"...

I got SyntaxError: expected expression, got '<' error in the console when i'm executing following node code var express = require('express'); var app = express(); app.all('*', function (req, res) {...

I read Mongoose SubDocs documentation so I made Schema like this: const mongoose = require('mongoose'); const Schema = mongoose.Schema; const StateListSchema = new Schema({ party: { ...

using a service and api to connect to I was able to display the whole array from my mongodb collection in catalog.component.ts : api.js const express = require('express'); const router=express.Router(...

I'm attempting to store user data when they register. I'm using a simple form in react. Node/express for the back end. I'm getting a 404 not found error. Caveat-- I have in my client's package....

I am trying to use forever so that I can assure that my ExpressJS app will remain running constantly. I am using Ubuntu 14.04 LTS. Strangely, 'forever list' displays nothing, 'forever --version' ...

So I have a form that only has two text fields and a button. When user clicks on the button to submit, I have a handleSubmit function that does an axios post to the express file in the backend. It all ...

In Nodejs with secure cookie and HTTPOnly behind a proxy server. How does HttpOnly flag and Cookie with Secure flag send it headers to proxy server? I have been reading and assume I need to enable X-...

I see different ways coders writing a module.exports function. 1st: module.exports = function() { return (async () => { })() } 2nd: module.exports = async () => { } What is the ...

I'm trying to insert a hashed password using sha2 into a mySQL table from a React Native app with the following code: connection.query( "INSERT INTO user(username, email, password) SELECT ...

Language

Popular Tags