Wednesday, 1 January 2020

Can i somehow use require on the server js script?

As is the title i want to use command require in the js called from html website.But if its not possible can i send the var to the main node file?

Submitted January 01, 2020 at 11:48PM by Hajdew

changeicon: My first NPM package, an easy way to change the icon (and version info!) of executable files. Give it the name of an exe and a .PNG or .JPG image, and it will take care of the rest.

https://github.com/GarretKadeDupre/changeicon

Submitted January 01, 2020 at 11:46PM by GarretDupre

Cookie it is not been setted by server, even tough the request is 200

Node.js tips and tricks to make your application more robust and secure. Please share your thoughts?

https://www.inkoop.io/blog/nodejs-tips-tricks-that-can-help-you-deliver-more-secure-and-robust-application?source=reddit

Submitted January 01, 2020 at 07:41PM by jaskaranrehal

How to build high available/fault-tolerant services in node

Hi everyone ,I am building a distributed algorithm to distribute data across a cluster of nodes .On top of this algorithm ( available as library ) will be possible to build high available and fault-tolerant services ( inspired to cassandra gossip )Anyone is interested ? Visit and contribute at https://github.com/pioardi/ring-election

Submitted January 01, 2020 at 06:06PM by pioardi

what am I missing on this post implementation in node/express?

The following url provides a pretty good walkthrough of how to wire up a node/express implementation to read from GCP Cloud SQL:https://medium.com/@austinhale/building-a-node-api-with-express-and-google-cloud-sql-9bda260b040fI implemented the steps in this article and my local implementation is working as expected. However, this url doesn't cover how to wire up inserts/updates. Based on some googling, I came up with the following implementation for a post/insert:// POST method route app.post('/users', function (req, res) { var post = { FirstName: req.FirstName, LastName: req.LastName }; var query = connection.query('INSERT INTO User SET ?', post, function (error, results, fields) { if (error){ console.log(error.message); } }); })I'm POST-ing the following request from Postman as raw JSON:http://localhost:3000/users/ { "FirstName":"John", "LastName":"Smith" }However, the response status is 404 Not Found. The standard GET is working as expected though. Any idea what I might be doing wrong here? Also, I'm new to Node/Express. What's the easiest way to get started debugging? For example, is there a recommended plugin for CDT that I can use for this? The sample code that I used for the GET used console.log("message") but when I tried this approach, nothing appeared to be written out to the node console window or to CDT?

Submitted January 01, 2020 at 04:56PM by random503

I'm starting a new Web project, what should be my stack?

It's 2020 and I'd like to start with a clean sheet and avoid legacy code!Should I keep Express or go Koa/Fastify/Restify/Nest.js?Should I use SQL/noSQL/GraphQL?Which frontend framework to avoid having nightmare every night??​The project is a very typical website

Submitted January 01, 2020 at 01:33PM by garypoc