Thursday 1 October 2020

API needed for calculating toxicity in users' comments

/r/webdev/comments/j3fekt/api_needed_for_calculating_toxicity_in_users/

Submitted October 01, 2020 at 09:40PM by sohumm

Noob question about ECONNRESET and error handling in general

Hi I‘m new to this, but I‘ve built a gameserver with Node and it works pretty well so far. Now all of a sudden my script crashes whenever I close the TCP connection on the client‘s side. Sending a request to the server to close the connection server sided works, but what if a client crashes (Alt+F4)?How do I find the mistake in my code? What do I need to change so that the server ignores disconnecting clients? VS outputs a bunch of code into the console and I dunno what to do with it. I‘m completely lost...

Submitted October 01, 2020 at 09:14PM by Deep-Gate

Any good electron code for user name/password authentication? (Not oauth)

i am looking for some code example code in electron js which can give me some guidance how can i authenticate username/password from the sqlserver database table. If the code sample in a course also i am ready to buy it. I couldn't find anything over the internet, so asking to the experts here.

Submitted October 01, 2020 at 09:21PM by selva-online

PostgreSQL and Firebase in one web application

i'm developing a web application with ReactJs(frontend) and NodeJs(backend) and it's using PostgreSQL for storage data. i also need realtime updates, chatting and notifications. should i use both of them in one app or is there a better solution? Note: i will create an mobile app in future for this web application

Submitted October 01, 2020 at 07:47PM by DareSame

Should I learn Backend Development or DevOps?

I wanna be able to work remotely from my country (Egypt) and I'm down to learn anything to speed up that process. I know some frontend basics and python, but that's about it.Which path would you choose?Path 1 - backend developmentPath 2 - devops

Submitted October 01, 2020 at 06:39PM by 29092

Wrote my first article on Node's thread pools. Would love some feedback!

This is my first time posting on reddit about NodeJS. I decided to share an article I recently wrote about Node's thread pool and some performance limitation to take into consideration when writing I/O and CPU intensive code. I'd love some feedback on the article. You can find it here:https://medium.com/@ochedid95/nodejs-thread-pool-performance-limitations-33e77811ff5b

Submitted October 01, 2020 at 06:20PM by omarchedid95

Wrote my first article on Node's thread pools. Would love some feedback!

This is my first time posting on reddit about NodeJS. I decided to share an article I recently wrote about Node's thread pool and some performance limitation to take into consideration when writing I/O and CPU intensive code. I'd love some feedback on the article. You can find it here:https://medium.com/@ochedid95/nodejs-thread-pool-performance-limitations-33e77811ff5b

Submitted October 01, 2020 at 05:39PM by omarchedid

Build a static site generator in 40 lines with Node.js

https://www.webdevdrops.com/en/build-static-site-generator-nodejs-8969ebe34b22/

Submitted October 01, 2020 at 03:54PM by tyrannosauru

Any thoughts on this article about generating a static site from a node site?

https://www.webdevdrops.com/en/build-static-site-generator-nodejs-8969ebe34b22/

Submitted October 01, 2020 at 03:51PM by tyrannosauru

Source files are not showing up in chrome devtools.

My services are running on a remote server. I used to debug those services from my laptop using ssh tunneling (using ssh -L command). IT guys recently upgraded the server. Since then, there are no source files showing up in devtools. Not able to open any file using (Ctrl + P). Could you please help me? Thanks in advance.

Submitted October 01, 2020 at 02:57PM by 12arijitroy

Stop Image upload to S3 if username update fails in Multer s3

I am developing an app that requires image upload to S3 and the user can update his profile pic and username at the same time , my problem is how do you stop the image upload to aws S3 if the username update fails for some reason like having the same username existing in the database ie.duplicate keys , currently what i implemented was update the user image and get the location of the file in s3 and save that link in the database and if user updates his image i reach out to the s3 bucket and delete his previous file and the upload the new one , now the problem is if username update fails once and i try to update it again, the file gets uploaded to s3 and the name updates,but the user image doesnt and i never get a response from the server and end up having duplicate files in my bucket which is the old profile pic and the new pic which is undesirable, is there a solution?here is the stackoverflow post for code refrence , am outta luck here , i've been stuck with this for a while now :https://stackoverflow.com/questions/64155106/stop-image-upload-to-s3-if-username-update-fails-in-multer-s3

Submitted October 01, 2020 at 02:37PM by the_excelsior22

[100% OFF] Get Started With NodeJS : For Beginners 2020

https://unitedaca.com/100-off-get-started-with-nodejs-for-beginners-2020-5/

Submitted October 01, 2020 at 02:03PM by codeeuler1

Most popular GraphQL server implementations

https://blog.graphqleditor.com/graphql-servers/

Submitted October 01, 2020 at 01:44PM by oczekkk

Jira Clone BE - Nestjs

Hello guys,You can check my small project :) https://github.com/ozergul/jira-clone-backend-nestI coded with NestJs, TypeORM.

Submitted October 01, 2020 at 12:31PM by ozergul

Can someone please explain this snippet?

So obviously there is a knowledge gap in my basics and hence can't figure this out-const validate = validations => {return async (req, res, next) => {console.log('check 3')await Promise.all(validations.map(validation => validation.run(req)));const errors = validationResult(req);if (errors.isEmpty()) {return next();    }res.status(400).json({ errors: errors.array() });  };};​This is being called byapp.post('/api/create-user', validate([body('email').isEmail(),body('password').isLength({ min: 6 })]), async (req, res, next) => {// request is guaranteed to not have any validation errors.res.send("succ")});the body() function inside validate in app.post is from express-validator​Now, how is app.post calling that middleware function const validate? I don't understand how the arguments are passing.validations is the argument list there which should receive validate([body('email').isEmail(),body('password').isLength({ min: 6 })])right?But how is another brace opening saying return async (req, res, next) => { the first 2 lines are where my confusion isconst validate = validations => {return async (req, res, next) => {

Submitted October 01, 2020 at 11:59AM by kjroger94

What is "npm start config" and "npm start recovery" does here?

Heyhttps://github.com/andreapizzato/tez-recoveryIn the project above you're supposed to install dependencies and then run the test script, after that you run "npm start config" and "npm start recovery", which according to my simple understanding of npm means there is two npm scripts named config and recovery. but there is no such scripts in the package.json.Can someone tell me what npm is actually doing when those two commands are run?Thank you very much :)

Submitted October 01, 2020 at 08:38AM by Taro_Naza

Am I misunderstanding module.exports? Advice please.

Using node.js I am attempting to share/modify an array across files. I have a main function that calls separate commands contained in other files. Breakdown:shared-list.jsdeclares an empty list named 'shared'declares 'shared' as a module export.function1.jsDoes the following inside an execute function as part of function1.js's module.exportsdeclares a list utilizing: const list = require('../shared-list');pushes a value to 'list'prints 'list' to consolemain.jscalls function1.executedeclares a list utilizing: var list =  require('../shared-list');prints 'list' to consoleWhen list is printed in function1 it always returns the expected value, but the value does not seem to persist when later called in main. I also noticed that the print statements happen in the reverse order than expected (main prints first followed by function1 module). If anyone is willing to help clarify what exactly I'm doing wrong I'd really appreciate it. If you need any more information please feel free to ask! Thanks.

Submitted October 01, 2020 at 08:54AM by PhilosophicalGeek