I believe the Erlang community is not envious of Node.js as it does non-blocking I/O natively and has ways to scale deployments easily to more than one processor (something not even built-in in Node.js). More details at http://journal.dedasys.com/2010/04/29/erlang-vs-node-js and Node.js or Erlang

Lastly, set the Valid OAuth redirect URIs field to you start the app now and click the Sign in with Facebook link, you should be prompted by Facebook to provide the required information, and after you’ve logged in, you should be redirected to the /success route, where you’ll see the…

If invalid, we need to pass back the submitted values to the view so they don’t need to re-enter them along with any error messages we want to (req, res) = { – res.render(‘contact’, { – data: {}, – errors: {} – }) – }) – – router.post(‘/contact’, (req, res)…

Using nodemon for hot reloading during development.Optimising for Docker cache layers — placing commands in the right order so that npm install is executed only when necessary.Serving static files (bundles generated via React/Vue/Angular) using serve package.Using multi-stage alpine build to reduce final image size for production.

Simple Dockerfile ExampleFor the base image, we have used the latest LTS versionnode:carbonDuring image build, docker takes all files in the context directory.

If any files change, nodemon will automatically restart your node application.We’ll build the image and run nodemon so that the code is rebuilt whenever there is any change inside the app directory.

OptimisationsIn your Dockerfile, prefer COPY over ADD unless you are trying to add auto-extracting tar files, according to Docker’s best practices.Bypass package.json ‘s start command and bake it directly into the image itself.

Assuming you are building a UI app using React/Vue/Angular, you would ideally build your final bundle using npm run build which would generate a minified JS and CSS file.The other alternative is to either 1) build the files locally and use an nginx docker to serve these static files or…

And install the tools required for testing – – Don’t forget to add the following lines to the package json – – Let’s create the first test file for our module: – – I always like to create a function called “up” to that encapsulates the creation of the table….

When I’m dealing with testing modules with a database, I usually create an extra describe block for those functions that need test data inserted.

This paradigm can also be applied if you don’t want your functions to call the database, you can stub out all of the functions one by one on the db object like this: – – As you can see, it is already a bit tedious work to restore all of…

Check out how easy it is: – – To take it an additional step further you can move the sandbox creation in a block: – – There is one last refactor to take on these tests, instead of stubbing each property on the fake object, we can use a mock…

Your last assignment is to go and fill your codebase with the knowledge you have learned and create greatly-documented test cases for your code in TDD style!

Tags: new module, test, test case, tests, proper test coverage

@RisingStack:Read this guide to get testing and TDD (test-driven development) right in @nodejs. https://t.co/1N5bkVYctM https://t.co/d63k5gir16

The React 16 (fiber) has been released; long-term support for Node.js LTS has been added to version 8; and the Next.js framework for server-side rendered React apps has come to version 4, and is intended for use with React 16.

In this brief article we will go through some of the key latest improvements in React, Next.js and Node.js.

These improvements are all related, as Next.js is the framework for server-side rendered React apps; React 16 has massive improvements on server-side rendering, and performs much better if you use the latest versions of Node.js.

In this brief article we will go through some of the key latest improvements of React.js, Next.js and Node.js, and for those who want to have a quick start we will also introduce my high performance starter kit.React 15 vs React 16Some of these key improvements are:Render does not need to…

The key feature of Next.js version 4 is the added support for React 16.