node.js 3

Section 27: An Introduction to Node.js - A Different JavaScript Environment

The goals 💪🏻What Exactly Is Node.js ✌🏻Writing Node.js Code 👍🏻Using Express.js 👊🏻Talking to a Database How to use File System const fs = require('fs'); fs.readFile('user-data.txt', (err, data) => { if (err) { console.log(err); return; } console.log(data.toString()); }); fs.writeFile('user-data.txt', 'username=Max', err => { if (err) { console.log(err); } else { console.log('Wrote to file!'); } })..

Section 18: Easier NodeJS Development with ExpressJS: Using a Third-Party NodeJS Library

The goals 💪🏻What & Why? ✌🏻Request & Response Handling With Express 👍🏻Parsing & Storing User Input Node Package Manager (NPM) Try Express const express = require('express'); const app = express(); app.get('/currenttime', function(req, res) { res.send('' + new Date().toISOString() + ''); }); // localhost:3000/currenttime app.get('/', function(req, res) { res.send('Hello World!'); }); // localhost:..

Section 17: NodeJS Introduction: Getting Started With Writing Server-side Code

The goals 💪🏻What Exactly Is NodeJS & How Does It Work? ✌🏻Installing & Running NodeJS 👍🏻Writing Our First NodeJS-driven Website What is NodeJS? A JavaScript Runtime A tool for executing JavaScript code (outside of the browser) Can be installed on ANY computer and hence be used to write and execute server-side JavaScript code Working with the "Command Line" The "Command Line" is a text-based inter..