adds code


https://truthseekers.io/node-js-tutorial https://github.com/truthseekers/learn-nodejs NVM install on Windows: https://youtu.be/KW7_F-6Vsa8 NVM install on Mac: https://youtu.be/BhLFxy6Jz8c 0:01 - Intro. Pre-requisites installing Node Version Manager or at least Node.js is required to follow this node js tutorial. 0:24 - Hello World Node.js In this part we create a very basic Node.js server that just starts up and prints hello world. We setup Nodemon to auto restart the server on changes, and show you how to setup a package.json script 09:14 - Hello Express JS - We create a basic Express server with a single simple endpoint. 12:45 - Get Requests in Node & Express. Express.js makes it easy for us to create endpoints for GET requests in our applications. We'll create an endpoint with parameters and query parameters so we can create search functionality and pages for individual items in a database. We'll also create an endpoint that displays all the products in a database. The search functionality uses the query parameters provided by the express servers request object to filter the array of products. 24:38 - importing and exporting in Express.js. Node.js allows you to separate code into multiple files so you can organize your code in an easy to understand way. You can then import and export functions as necessary into different files throughout your Express.js application. 29:14 - HTML in Node.js - Learn how to interact with HTML in Express.js and Node applications by setting the "view" and enabling static files to be accessible. 32:48 - JSON DB and Post Requests - Being able to add new data and update existing data is a very common need in Node.js applications. We'll show you how to use POST requests in Express.js to update data. 49:27 - Environment Variables in Node.js - Use Environment variables to secure your secret information. 53:11 - Pug Views Eight - It's easier to interact with an Express.js app when you have a front end to work with. Pug allows you to setup simple files that a user can interact with to submit get and post requests, and view data coming from your Nodejs application. 1:09:30 - Middleware in express.js - There's a few different ways to run a function in more than one place in Express. If you want a request to pass through multiple functions, you can use middleware. For example, If your node.js app authenticates a user, you may want to make sure the user is properly logged in before they're able to hit the target endpoint. If they're logged out you can redirect them to the login page. Or maybe you need to make sure the request is coming from an approved IP address. 1:22:59 - Error Handling - Learn a variety of ways to handle errors in Node.js. 1:32:50 - Custom Error Handlers for Express Middleware 1:36:41 - Connecting Express / Node.js applications to MongoDB & MySQL
Previous Post Next Post